sockets - Delphi: TTcpServer, connection reset when reading -


I am trying to implement one for Delphi, but there are some problems with communication.

Fitnesse will start my process, and give me a portmember as a command line argument.

Then I should make a socket on the port number given to me, and fitness will connect to that port

I am using a TCPCP server for the job:

< Pre> TcpServer1.LocalPort: = ParamStr (ParamCount); TcpServer1 Active: = true; On

OnEXEPT () -Event, I send the protocol version to use as specified in the protocol.

Process TForm1.TcpServer1Accept (From: TOBject; ClientSocket: TCustomIpClient); Var s: ansistring; Start clientSocket. Syndrome ('slim - v 0.0', # 10); SetLength (S, 6); ClientSketts Receavebook (S, 6); End;

When I call ReceiveBuf (), the process ends, and fitness throws an exception:

  java.net.SocketException: connection Reset  

I have seen what sent and received. It shows that my code sends the protocol version, fitness sends back a message, and when I try to get this message the connection is reset.

Do anyone know what might be the reason for this? Am I doing something wrong?

BTW, everything is fine when I use the Java Slim server which comes with fitness. Then the OSP shows the same communication, first to read. Although my attempt to read fails, but it does one thing as expected.

Take a look at this web site A + source code


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -