View Full Version : Streams And Sockets?
DeepBlackMagic
07-15-2003, 06:21 AM
Ok, how is everybody doing sockets these days. Im still back in the stone age printf'ing into a buffer, and sending the buffer. Is it possible in this great new day and age to use streams to do socket io? like mystream << mysocket, or std::getline(mysocket,mystring,widen('\n'));? If anybody has a better way to do socket io using winsucks...erm... winSOCKS, im deffinetly interested in finding a better way than old sprintf(mybuff, "somestuff\r\n"); send(mysock,mybuff,strlen(mybuf),0);
Thanks for your time.
Hammer
07-15-2003, 06:24 AM
Sounds like this should be in the networking forum... moving.
DeepBlackMagic
07-15-2003, 06:31 AM
Its more of a C++ question than a networking question, i have no problems with the networking, its the streams im curious about.
Hunter2
07-18-2003, 11:46 PM
Well, you could always overload the << and >> operators for your socket wrapper class (i.e. Socket ;)) and for the stream... dunno how much effort that would save though.
DeepBlackMagic
07-18-2003, 11:58 PM
=P the streams are for a seperate project. more a question of compadibility than anything else.
ygfperson
07-21-2003, 06:30 PM
The flashchat program I posted a week ago on this forum uses sockets like that.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.