Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: IdTCPServer

www.cryer.info
Managed Newsgroup Archive

Re: IdTCPServer

Subject:Re: IdTCPServer
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Thu, 8 Jun 2006 12:00:32

"brandon" <someone@microsoft.com> wrote in message
news:448869e3@newsgroups.borland.com...

> I have an app that are using a IdTCPClient(v9.0.14) and
IdTCPServer(v9.0.14)

The current snapshot version is 9.0.50.  You should consider upgrading to
make sure you have all of the latest bug fixes.

> to handle some messaging between peers(simple IRC).

Any reason why you are not using TIdIRC and TIdIRCServer?

> Occasionally, the server will not allow clients to connect and
> gives the following error:
>
> Exception 'EIdSocketError' in module XXX.exe at 0020537B
> Socket Error # 0
>
> Source file: IdStack.pas, Line 223
>
> Call stack:
> :Idstack.TIdStack.RaiseSocketError (IdStack.pas, line 223)
> :Idtcpconnection.TIdTCPConnection.WriteBuffer (IdTCPConnection.pas, line
> 799)
> :Idtcpconnection.TIdTCPConnection.Write (IdTCPConnection.pas, line 762)
> :Frm_communicator.TfrmCommunicator.btnRefreshClick (frm_communicator.pas,
> line 213)

That call stack does not match the code you have shown.  Not only that, but
your call stack is incomplete anyway, since there is a lot more going
between Write() and RaiseSocketError() that you haven't shown.  Neither
Connect() nor Connected() of TIdTCPClient ever call TIdTCPConnection.Write()
anyway.  The only way Write/WriteBuffer() could be throwing the exception is
if Connect() is actually successful and then the exception occurs in your
call to WriteLn() instead.  Which is a very different issue then you have
described.

> Restarting the server app fixes the problem, but does not explain
> why it occured in the first place.

There is no way to diagnose the problem given the minimal details you have
provided so far.  Especially since you did not show your server code.  What
is probably happening is that the server is disconnecting the socket before
the client can finish writing to it.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive