I understand your point, in fact I've already refactored my server with
OnDataSent.  Yet I am concerned by the fact that this large block was not
going through, something for which I have no explanation.  In fact in some
cases I had only about 32KB transferred before things would stop working.

Looking at TWSocket code, I don't see why one could not send 20MB in one
chunk, although I admit it is not necessarily the best idea in the world.
In reality I am afraid of being hit by this situation even with 64K blocks.

>From what I can tell, the problem occurs when calling Winsock.send
repetitively while the socket is busy transferring and cannot temporarily
accept more data.  While this should only return a WSAWOULDBLOCK indication,
which ICS handles correctly, it also seems to disrupt the socket output
functionality once in a while.

May be I should not overthink it and simply keep my blocks small enough, but
one side of my brain tells me something is wrong...

Raymond



-----Original Message-----
From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Angus
Robertson - Magenta Systems Ltd
Sent: July-03-13 9:18 AM
To: twsocket@lists.elists.org
Subject: Re: [twsocket] Problem sending large block of data

> I've used TWSocket/TWSocketServer to build client/server successfully 
> in the past.  Now I have one where I need to send a 20MB block of data 
> from server to client.
> it is my understanding that TWSocket is built to handle this situation

Not sure why you expect to send a single block 20MB in size, none of the ICS
high level components or demos attempt to do that.  64K is about the maximum
block size sent. 

Normally you use the OnDataSent event to send the next block of data, as
illustrated in numerous components.  It is not much more effort, you just
need to keep track of how much you have sent so far.  

Angus





--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to