Which are the correct steps for closing a client TCPsocket?

Hi,

In my application I send a data to a TCP server.
Later I try to close the socket and the gprs.

To close the socket I send :
ed_SendDataExt( “”, 0, TRUE, ED_ID_TCPSOCKET_1 );

To close the gprs I use :
adl_atCmdCreate(“AT+CGATT=0”,TRUE,CGATT_0,"*",NULL );

When The GPRS is deact in TCPHandler(s32 ResponseCode, TeDHandle id)
the ResponseCode is :ED_ERR_GPRS_SESSION_LOST and if I restart the GPRS ed the new socket I always have the same answer.

I have also used : ed_DialupConnectionStop(); after I receive ED_OK_ON _HOOK but then in
TCPHandler(s32 ResponseCode, TeDHandle id)
the ResponseCode is always ED_ERR_GPRS_SESSION_LOST

Can you help me?

Thanks.

Hi,

I have resolved my problem, and the problem was in the server.

But I now have another question.

When I send ““ed_SendDataExt( “”, 0, TRUE, ED_ID_TCPSOCKET_1 );””
in TCPHandler(s32 ResponseCode, TeDHandle id)
the ResponseCode is : ““ED_OK_TCP_CLOSED:””,but my server doesn’t produce any event of TCP closing and when in my wavecom application (FASTRACK) I restart the GPRS and the new socket I can send data to the server , but the problem is that in the server I find two open sockets.

Can you help me?

Thanks.

Hi gioiese,

I would also expect that this is a problem of the server. I have used the same command in a wavecom module and sure enough it closed the socket on the server side…

Best Regards,
Jan