I managed to solve this issue, point was that the banner is alway sent and I was closing the socket while data was still sent. I'm now closing the socket at the right time and this works well now (verified on server).

However another problem arises. If I reconnect I get a WSAAsyncSelect exception.

Invalid argument (#10022 in WSAAsyncSelect)

from the line
  SocketError('WSAAsyncSelect');

in OverbyteICSSocket.

Now this realy puzzles me. I've waited for all the events to occur before closing the socket. I wait for the event that the socket is closed. Then I want to send new data, the socket is filled with the correct parms, connected and... the error. Anybody knows why?

albert

----- Original Message ----- From: "A Drent" <a.dr...@aducom.com>
To: <twsocket@elists.org>
Sent: Tuesday, May 04, 2010 12:11 PM
Subject: [twsocket] client problem


I have a small webapplication who needs to connect to several servers depending on the data sent. The response of this server will be send back to the end-user. The server responds well. If I use the clientdemo it all works as expected.

However, in my webapplication things go wrong while the code is straight forward like the clientdemo. There are only a few things differently: I need a synchronous call. So I have to wait until the ondatasent has finished. On this event I set a status bit to allow the application to go on. The first time it works, the second time, it doesn't, the third time it works, etc.

I'm using the messagepump of the clientsocket to wait:

function TWebModule5.BuildUDDI : string;
begin
  bMsgOk := false;
  while not bMsgOk do begin
     CliSocket.MessagePump;
     sleep(100);
  end;
  result := Buffer;
end;

I'm sure I'm doing things wrong. Hints?

albert
--
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