help need with data transfer

Started by
0 comments, last by xarak 21 years, 8 months ago
Hi everyone, Okay I make a little chat room, whit one server and client. But I want to know it''s is neccessary when send packet adding the endofdata "\0". Because my server when reading packet it''s read 2 packet in one and because of "\0" it''s scrap the second packet. server : packet = sprintf(buffer,"%d:@W:Y\n",C_NAMELIST); send(sock,buffer,packet+1,0); packet = sprintf(buffer,"%d:%s\n",C_ADDNICK,player.username); send(sock,buffer,packet+1,0); client : packet = recv(fdread.fd_array, data, sizeof(data), 0); it''s have one big packet of 21 char but I can''t access the second command . Please someone help me !!! Thanks!
Advertisement
why are you doing packet+1. Umm, also try calling recv() again.

This topic is closed to new replies.

Advertisement