Hello Dod,
Maybe another apprach is to use always a timeout and reset it every
time data is received. But then you have to send keep alive packets to
not get disconnected in case there is no real traffic needed.
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz
Monday, February 13, 2006, 11:21, Dod wrote:
> Hello Wilfried,
> OK, that is what I thought but now I am sure :-)
> Usually I much prefer Lined mode as it is simpler to manage, and may
> be used for binary transport if you take care to "backslash" #13 and
> #10.
> In non-lined mode I know I need to add some Size tag at beginning of
> buffer sending to tell receiver how sized will be data.
> Only thing is to add some Timer to detect too long delay before full
> buffer is received with something like :
> FOREACH CONNECTED_SOCKET as ASocket
> {
> IF (ASocket.ReceivingModeFlag=true)
>AND (time last packet received > xx seconds)
> THEN send some message to socket thread to expire
> }
> Regards.
WM>> Hello Dod,
>>> Using line mode OFF, if I do for example a .Send of 500 bytes, the
>>> receiver should get just one OnDataAvailable event.
WM>> Mostly, but not for sure. You can also receive more bytes if the sender
WM>> sends a second packet a little later. TCP does not respect packet
WM>> boundary.
>>> If it will produce miltple OnDataAvailable, is there a way to predict
>>> how many time it will be triggered ?
WM>> No it is not predictable. Please read TCP/UDP primer on overbyte
WM>> website.
WM>> If you dont use LineMode then you have to include the length of each
WM>> packet in it, or tell the receiver what he expect to receive by means of
WM>> a protocol.
WM>> ---
WM>> Rgds, Wilfried [TeamICS]
WM>> http://www.overbyte.be/eng/overbyte/teamics.html
WM>> http://www.mestdagh.biz
WM>> Monday, February 13, 2006, 10:29, Dod wrote:
>>> Hello,
>>> Using line mode OFF, if I do for example a .Send of 500 bytes, the
>>> receiver should get just one OnDataAvailable event.
>>> But if I send a 100KB buffer, will I receive get a OnDataAvailable
>>> after those 100KB are sent or will it be triggered XX times depending
>>> the network path (and possible packet split) between sender and
>>> receiver.
>>> If it will produce miltple OnDataAvailable, is there a way to predict
>>> how many time it will be triggered ?
>>> Regards.
--
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