Board index » delphi » Indy TCP server and Java client

Indy TCP server and Java client

Hi,

I have a Java client that sends  blocks of data to a IdTCPServer.
The client does this by openening a connection, send the data and then close
the connection again.
I know it is not the most efficient way, but I can not change the protocol
used because
I do not have the code of the server application (I do know its Indy!)

At the server side: for each connection a thread is started, the received
data is
processed....but...
As the connection is closed by the Java client the thread that was handling
it keeps on running?!?

Funny thing is that when I create a similar client in Delphi using the exact
same method
of connection and data handling the threads 'die' as they should.

I created a dummy server for test purposes and tried to resolve the problem
I experienced with the Java client.
When the data is "handled" by the dummy server and I explicitly disconnect
the Java client from the server-side the connection-thread 'dies' as it
should ?!?

As I said earlier I do not own the code to the real server application so I
cannot implement
the server side disconnect (if I had the code I probably would change the
whole protocol....).

So, is there anyone who could tell me if (and how) I could force a
serverside disconnect  from within Java?

Thanks,
Pim

 

Re:Indy TCP server and Java client


Is the connection closed/disconnected properly by your java client?

Helge.

Re:Indy TCP server and Java client


Apparently not.

Your remark made me realize something:
After processing the data the server sends a confirmation line.
The client reads this line before shutting down.

After I adjusted the client to read all data from its receive buffer before
closing the connection, the connections closed gracefully and the threads
died.

Thanks.

Quote
"Helge Jung" <he...@eco-logic-software.de> wrote in message

news:3b784a99_2@dnews...
Quote
> Is the connection closed/disconnected properly by your java client?

> Helge.

Other Threads