TCP Client <-> Server connection problem

Hi,

I’m making some test with the new WIP library 2.00.12 and I’m having some problems regarding TCP Client<->Server socket connections.

I’m doing the following steps (after the GPRS connection is established):

  1. I create a TCP server;
  2. I make a TCP connection from a TCP client;
  3. I receive the WIP_CEV_OPEN;
  4. I send some data to the server, but I just dont’ read it (I just don’t do anything);
  5. I close the socket from the client side;
    (and now the issue…)
  6. I don’t receive the WIP_CEV_PEER_CLOSE in the server;

As I don’t receive the WIP_CEV_PEER_CLOSE, I can’t close this socket channel, and after a few connections, all the sockets available can be blocked and no more clients can connect to the server.

Also, when I don’t read the data sent by the client, I don’t get more events WIP_CEV_READ if the client sends more data again.

If I read the data sent from the client, I receive the close event and I receive the event WIP_CEV_READ if the client sends more data.

Anyone have any ideia about this issue?

Thanks,

GG

You don’t have to wait for PEER_CLOSE to close a socket. In many cases, including yours, you’ll never receive a PEER_CLOSE from the server: just call wip_close(), and it’s WIP’s job to make sure that whatever’s required to close the connection actually happens.