How to close a TCP connection ?

3 thoughts on “How to close a TCP connection ?

  1. Hi, i’m having problems closing TCP connection after data is transferred with GE865.

     

    I open a generic TCP server on my pc at port 3000 for example, and on GE865 i run:

     

    AT#SGACT=1,1                          OPEN CONTEXT

    AT#SD=1,0,3000,"www.myserver.com"   OPEN SOCKET

     

    <SEND ASCII DATA TO SERVER>

    <WAIT GUARD TIME FOR ESCAPE SEQUENCE>

     

    +++

    AT#SH=1                                CLOSE SOCKET

    AT#SGACT=1,0                           CLOSE CONTEXT

     

    Everything is fine till here, but the problem is that now, then  connection isn’t closed on the server, when i run netstat there’s the connection on CLOSE_WAIT status, and stays there for some time:

     

    TCP    PC:3000                myproviderip.3G.telemar.net.br:7731  CLOSE_WAIT

    Is there a way to force the connection to close ?

     

    Thanks

    1. Hi Bruno,

       

      From the explanations here seems is your server applications that delays things, please check.

       

      1. Hmmm, that’s correct, it seems my server is not sending the FIN message.

         

        I thought it has something to do with the <reliability> parameter of the AT+CGQREQ command.

         

        Thank you