Hi Surabaya, As mentioned early, you have to create your own protocol to send and receive data, bcoz TCP does not have the fix-ed packet size received.
So you have to send a header out to tell the total bytes to be send, and the receiving end have to base on this header to receives all the data before consider a whole data received. Regards KL Chin -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Surabaya Sent: Thursday, January 19, 2006 1:38 PM To: ICS support mailing Subject: Re: [twsocket] Sending 7 Kilobytes of data Yes, I think I used TCP since I'm using TWSocketServer On 1/19/06, KL Chin <[EMAIL PROTECTED]> wrote: > > Hi, > > If you were using TCP, then it was correctly received. > > You have to create you only routine for sending and receiving the data, > with header to indicate the buffer length send out. > > Regards > KL CHin > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Surabaya > Sent: Thursday, January 19, 2006 12:52 PM > To: twsocket@elists.org > Subject: [twsocket] Sending 7 Kilobytes of data > > > Hello, > > I need to send a bunch of data, in size of about 7 Kilobytes, > > if I sent it all at once using "client.Send(@fm, sizeof(fm));" the client > cannot always receive it succesfully, sometimes it is received all at > once, > but sometimes the client received only 1,5 Kilobytes > > If I sent it in 5 pieces, sometimes the client received 5 packets, each of > 1222 bytes, but sometimes the client received 1222bytes, 1222bytes, > 2444bytes, 1222bytes. Or 1222bytes, 1452bytes, 1222 bytes, and so on > > I think it depends on the connection speed, > > I need to send those 7 Kilobytes of data safely and fastly, can you help > me.... > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://www.elists.org/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be