I am debugging a Basex client built in C#. The client is based on the Git Hub example https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23. The problem is, every now and then the client drops the session. It might be, that the client drops the connection if the server takes too much time to answer (or something). So I need some way to emulate slow connection or connection dropping packages. I downloaded TcpCatcher (http://www.tcpcatcher.org/) and set it as a proxy (client talks to 21984; TcpCatcher catches packages and send them to BaseX listening to 11984). But It seems that BaseX does not respond.

 

I took BasexClient.cs and Example.cs from the github and tried with them. I get three packages; one coming from the server and two going to client; but after that nothing. The Example prints “Access Denied”.

 

I guess this comes from:

 

   socket = new TcpClient(host, port);

      stream = socket.GetStream();

      ehost = host;

      string ts = Receive();

      Send(username);

      Send(MD5(MD5(pw) + ts));

      if (stream.ReadByte() != 0)

      {

        throw new IOException("Access denied.");

      }

 

that is: client gets ts (timestamp?), sends username and password with timestamp; but receives nothing.

 

So how can I use TcpCatcher (or other proxy program) with Basex client?

 

(Basex 7.7; windows 7)

 

Arto Viitanen

Microteam Oy