Share via


Terminating a GPRS connection

Earlier I have posted an article on establishing a GPRS/EVDO/EDGE connection with TcpClient in managed code. The post generated a number of questions from users and one of the common questions was that the code works them, but the connection remains open after the request has been closed. This is the behavior of Connection Manager, an OS component in Windows CE, in that on PPC and SP 2003 and later, the connection remains open even when we call ConnMgrReleaseConnection() passing in 0 as the second parameter. They probably base this behavior on the fact that connection is charged nowadays on the bandwidth used, not on the duration of the connection, and that keeping the connection open reduces the time needed for reestablishing the connection in case it is needed in future. In case you really need to close the connection for some reason, someone suggested you can use RasEnumConnections() followed by RasHangUp(), but I have not verified the calls and parameters needed for this.