The normal disconnection happens if the server closes the socket without error. So, your server is immediately closing the socket after sending the reply. This means that if you treat that as a failure and try to do the same thing again, you'll get exactly the same behaviour each time. You need to check the protocol for the server. It may not allow for a single session with many requests.

Nick.

wonton wrote:

Hello list,
I seem to be having a slight issue with a Client::TCP component and
would appreciate any guidance from those more experienced in the whys
and hows of POE.
In essence I have a very simple app. that connects to another server,
send an initialisation packet and then sends a request. If the
initialisation is successful, the same packet is echoed back to my app.
and then I attempt to send the request. However,  after the init.
packet is sent (and the response received) I receive this error "Client
2 got read error 0 (Normal disconnection)".
From a bit of googling I have determined that this is not an error as
such (informational). Now if I handle the server_error state explicitly
with a "reconnect", the app loops indefinitely, initialising and then
the socket error and then reconnecting and then intialising again etc.
Obviously this isn't quite what I had in mind. (Ultimately there will
be many more of these messages travelling between my client and the
server and they are alway a request/response type setup).
Admittedly, I am only a couple of days in to POE and am still coming to
terms with the change in perspective required by POE, which begs the
question: am I approaching this incorrectly? trying to squeeze a square
block into a round hole? ;) or have i just missed something incredibly
simple?
any help/insight would be greatly appreciated.
cameron


Reply via email to