Delphi: TTcpServer, connection reset when reading

I am trying to implement Fitnesse Slim server for delphi, but there are some problems with the message.

Fitnesse will start my process and give me the port number as a command line argument.

Then I have to create a socket in the specified port number, and Fitnesse will connect to this port.

I use TTcpServer to set:

TcpServer1.LocalPort := ParamStr(ParamCount);
TcpServer1.Active := true;

In OnAccepted () -event, I submit the protocol version for use as specified in the specification.

procedure TForm1.TcpServer1Accept(Sender: TObject;
  ClientSocket: TCustomIpClient);
var
  s: ansistring;
begin
  ClientSocket.Sendln('Slim -- V0.0', #10);
  setLength(s, 6);
  ClientSocket.ReceiveBuf(s, 6);
end;

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

java.net.SocketException: Connection reset

oSpy, , . , , , fitnesse reset, .

- , ? - ?

Btw, , java slim server, . oSpy , . , , .

0
1
0

Source: https://habr.com/ru/post/1753339/


All Articles