This article applies to BlackBerry® Device Software.
There are several mechanisms available to developers to open connections to the network from a BlackBerry device. For example, developers can use the BlackBerry Mobile Data System™ (BlackBerry MDS™), provided with the BlackBerry Enterprise Server™, to connect to web servers behind the corporate firewall.
When connecting to the network, the application must properly close the connections for the following reasons:
There is a specific order expected for closing connections, as shown in the code sample below. Therefore, it is important to close the input stream, output stream, and then the connection itself. Also, these steps should be completed in a
HttpConnection conn = null;