What is the recommended approach to close-down a GPRS sessio


#1

Not really a WIP question this, but does anyone know the recommended sequence of events for closing down a TCP client/server connection? Is it initiated by the server or the client ?

Scenario: My server occasionally needs/wants the (GPRS modem) clients to close their connections (for server update/maintenance), and I’m just not sure best/proper way to do it.

Given that the client(s) requests a connection on the server, should the client(s) then be the one responsible for closing the connection down (having been so instructed by the server), or can the server just throw them off ? Either can be made to work, but is there a preferred approach ?


#2

Hi,

The wip_shutdown () function can be used to close the WIP connection.The
WIP_CEV_PEER_CLOSE event will be received in the TCP event callback function.When this event is received,the wip_close () function can be called on the TCP channel which can be followed by a call to wip_bearerStop () and when the WIP_BEV_STOPPED event is received,the bearer can be closed.


#3

I don’t think there is a preferred approach, and I think both should be handled by both the server and client. If the server terminates the connection, you will get a WIP_CEV_PEER_CLOSE event on the client, and can perform a graceful TCP shutdown on the client as described in the above post.