I am trying to make POP3 proxy/gateway, I am working linemode ON as it
a CRLF lined protocol so its easier.

But  I  noticed  that  not  all lines are sent back to POP3 client, so
e-mail (especially the ones with attachements) get corrupted.

Each  time I go into OnDataAvailable on server-side socket I loop into
ReceiveStr()  and  call  TWSocketClient.SendStr() on client socket for
each line.

Is  there  something  wrong with this scheme

I assume you have set LineMode to true.
No need to loop beause ReceiveStr() will receive the complete line received so far and if more lines are available, then more OnDataAvailable events will be triggered.

do I overload the WinSock internal  buffer  ?

No risk. TWSocket buffer outgoing data in his own internal dynamically allocated (only limited by available memory) and move data to winsock when winsock notifies about space available in his buffers.

should I use a man-in-the-middle StringList buffer
and  when  OnDataSend  on  client side I loop SendStr un until no more
lines from StringList buffer ?

Defenitely not.

The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)

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