How to close (hang up) a data call that has opened from a Personal Java application? Closing a socket is not sufficient: It does not disconnect the data call, or it is closed only after a connection timeout.
RE: Disconnecting a data call from a Personal Java application
2002-06-18, 01:28#2
It is not possible to disconnect a data call connection directly from a Java application. However, the workaround is to use a JNI wrapper for a NIFMAN (network interface manager) C++ API.
NIFMAN provides a monitoring API which allows applications to monitor the status of the network connection, and display it to their users.
First close the socket normally. If there are no other application sockets currently connected, the following simple C++ code will cause the connection to be immediately closed:
---CLIP---
#include <nifman.h> // for RNif (nifman.lib)
RNif nif;
if (nif.Open() == KErrNone)
{
nif.Stop();
nif.Close();
}
---CLIP---
Please see the documentation and examples from Nokia 9200-series SDK for Java on how to use JNI.