# Closing Connection and Spawned Sockets question

**URL:** <https://forum.sierrawireless.com/t/closing-connection-and-spawned-sockets-question/2869>\
**Category:** Open AT\
**Created:** [January 27, 2009, 11:40am UTC](https://forum.sierrawireless.com/t/closing-connection-and-spawned-sockets-question/2869 "2009-01-27T11:40:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Banses](https://avatars.discourse-cdn.com/v4/letter/e/3be4f8/32.png) [@Ed\_Banses](https://forum.sierrawireless.com/u/Ed_Banses)\
**Post date:** [January 27, 2009, 11:40am UTC](https://forum.sierrawireless.com/t/closing-connection-and-spawned-sockets-question/2869/1 "2009-01-27T11:40:44Z")

</div>

Hi all,

First of all, thanks for keeping this great forum working. Without this forum, developing Open At with only the documentation supplied would be really difficult.

I am working on an application to link a datalogger connected with a Wavecom Fastrack Supreme (firmware version 7.3\_00 with Open AT 6.20.04 and WIP library 5.10.2020) acting as a server using GPRS with a remote PC using Winsoft-Hiperterminal.

I have managed to get the link working with bi-directional communication. The problem I am facing now is how to properly close the communication between.  
The way I am doing it is by calling wip\_close and the wip\_bearerClose, using a delay of 2 sec (I do not like delays) between them to allow the queued socket to be close.  
So my first question is: Is there any Event from Open At notifying when the socket is closed after calling wip\_close. Shall I call wip\_netExit instead or after than wip\_bearerClose?

My second issue is understand how the spawned sockets work and how can I identify them. If I close the connection from the PC and I connect it again, the modem accepts the connection but I cannot transmit data anymore between them. I suspect this is because this is a new socket and I am not reading it correctly?

I will appreciate your help on this.

Eduardo
