🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Chatting in TCP/IP

Started by
2 comments, last by Azrael 23 years, 9 months ago
im new to TCP/IP and I was considering how do you send in winsock a chat message? (you only have to send 4 bytes per packet right?) how do you do that? if your message is too long?
Advertisement
You can send packets much larger than 4 bytes. If you were writing a chat thing in TCP/IP, just send a larger packet and when the other computer receives the packet it can convert the packet to a character string. Shouldn''t be too difficult to program.
Alexbigshot@austin.rr.comFoolish man give wife grand piano. Wise man give wife upright organ.
Its works like files, the sender writes out to a ''virtual'' file and some time later it shows up in the recievers ''virtual'' file.

Your program get a msg telling it when more data arrives.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
If you use TCP/IP sockets there are no packets. You''re streaming data, so in theory your packets send will be 1 byte or 1000 orso...

    char *p = "blablabla and some more stuff\r\n";send(s, p, lstrlen(p), 0);    


This topic is closed to new replies.

Advertisement