[twsocket] Converting some perl to Delphi using sockets

2007-09-13 Thread A Drent
Hi, We use a small perl script to exchange data between a webserver and an application server. I was looking to change this to Delphi. Can someone give a hint how to do this the best way using the ICS components? Best regards, Albert Drent university of Groningen use IO::Socket; # # To let thi

Re: [twsocket] TWSocket Stop Listening After Certain Numbers ofConnected Clients.

2007-09-13 Thread Erich Kuba
Hi Edward, Seeing as you raised this issue, and I have been experiencing the same thing, I thought I'd dedicate the day to trying to understand what is happening, and the good news is that I've managed to solve my problems, and gained a valuable understanding of the problem. Here's the thing. As

Re: [twsocket] Converting some perl to Delphi using sockets

2007-09-13 Thread Francois Piette
Use TWSocket component to connect to the server using same parameters (127.0.0.1/TCP/1099). Then send the data in the same format, then grab the response (using OnDataAvailable event and Receive method) then gracefully close the socket (Shutdown). Contribute to the SSL Effort. Visit http://www.ove

[twsocket] UDP ReceiveFrom error

2007-09-13 Thread Lorenzo.Herrerias.external
Hi, I have two UDP listener sockets in a worker thread (I use a thread because is a DLL). When I receive any data in the OnDataAvailable, ReceiveFrom method call return -1 and OnDataAvailable is triggered in a infinite loop. The same code with Receive method works fine. What is wrong? Could be a

Re: [twsocket] TWSocket Stop Listening After Certain Numbers ofConnected Clients.

2007-09-13 Thread Wilfried Mestdagh
Hello Erich, I see in your other mail that your problem is solved. So here I try to answer to your additional questions. > What influences how much buffer RAM is used by each socket. It is the socket itself and also the data. A socket takes around 4 KB. Overlapped IO takes also pages of 4 KB but

Re: [twsocket] UDP ReceiveFrom error

2007-09-13 Thread Wilfried Mestdagh
Hello Lorenzo, You only can call Receive or ReceiveFrom 1 time in OnDataAvailable. Don't loop in it as in your example. This could be the trouble. If you don't have received all available data then OnDataAvailable will fire again and there you receive the rest. However with UDP packet bounds are

Re: [twsocket] UDP ReceiveFrom error

2007-09-13 Thread Lorenzo.Herrerias.external
Hello Wilfried, thank you for your help. I've changed my code but the problem persists. Internally RecvFrom is Result := DoRecvFrom(FHSocket, Buffer^, BufferSize, 0, From, FromLen); if Result < 0 then FLastError := WSocket_Synchronized_WSAGetLastError else FReadCount :

Re: [twsocket] UDP ReceiveFrom error

2007-09-13 Thread Wilfried Mestdagh
Hello Lorenzo, I see one bug. Possible that's the reason: FromIPLen = sizeof(FromIP); // Add this !! rec = server->ReceiveFrom(block, sizeof(block), FromIP, FromIPLen); --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz -- To unsubscribe or

Re: [twsocket] UDP ReceiveFrom error

2007-09-13 Thread Lorenzo.Herrerias.external
Hello Wilfried, I can't explain why I didn't see it before! Now it works fine! Thank you a lot for your help. Lorenzo. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nombre de Wilfried Mestdagh Enviado el: jueves, 13 de septiembre de 2007 14:48 Para: ICS support mailin