# TCP Client \<-\> Server connection problem

**URL:** <https://forum.sierrawireless.com/t/tcp-client-server-connection-problem/1227>\
**Category:** Open AT\
**Created:** [March 29, 2007, 3:59pm UTC](https://forum.sierrawireless.com/t/tcp-client-server-connection-problem/1227 "2007-03-29T15:59:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggouveia](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@ggouveia](https://forum.sierrawireless.com/u/ggouveia)\
**Post date:** [March 29, 2007, 3:59pm UTC](https://forum.sierrawireless.com/t/tcp-client-server-connection-problem/1227/1 "2007-03-29T15:59:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fft](https://avatars.discourse-cdn.com/v4/letter/f/e8c25b/32.png) [@fft](https://forum.sierrawireless.com/u/fft)\
**Post date:** [May 28, 2007, 1:58pm UTC](https://forum.sierrawireless.com/t/tcp-client-server-connection-problem/1227/2 "2007-05-28T13:58:39Z")

</div>

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.
