0

I'm trying to implement a Fitnesse Slim server for delphi, but have some problems with the communication.

Fitnesse will start my process, and give me a portnumber as a commandline argument.

Then I'm supposed to create a socket at the given portnumber, and Fitnesse will connect to that port.

I'm using a TTcpServer for the job:

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

In the OnAccepted( )-event, I send the protocol version to use, as specified in the spec.

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 fitnesse throws an exception:

java.net.SocketException: Connection reset

I have used oSpy to see what get sent and received. It shows that after my code sends the protocol version, fitnesse sends a message back, and that the connection is reset when I try to receive this message.

Does anybody know what the reason for this can be? Am I doing something completely wrong?

Btw, everything works ok when I use the java slim server that comes with fitnesse. oSpy then shows the same communication, up to the first read. While my attempt to read fails, this one works as expected.

Vegar
  • 12,828
  • 16
  • 85
  • 151
  • 1
    Hi Vegar, I have written a Fitnesse Slim Server yet. But I use the Indy-Components. It works with all test cases in the Fitnesse-Wiki but I don't support Runtime Packages. For me it was a test of the new Rtti-Features of Delphi 2010. So it compiles only with Delphi 2010. I am very interested in sharing my code to get some feedback. So if you like or anybody else leave here a note. – Heinz Z. Oct 20 '09 at 07:39
  • @Vegar, I don't find a way to send a private message to an other stackoverflow.com user, so can I send an eMail to info at your homepage? I will send the source tomorrow. – Heinz Z. Oct 20 '09 at 10:07
  • @Heinz: contact established :-) – Vegar Oct 20 '09 at 12:58

1 Answers1

0

have a look at this web site for a delphi Fit server + source code

Charles Faiga
  • 11,665
  • 25
  • 102
  • 139