Methods Summary |
---|
private native boolean | accept(int index)Accepts a pending client connection.
|
public javax.microedition.io.StreamConnection | acceptAndOpen()Returns a StreamConnection object that represents a server side
connection.
try {
closeRq = false;
for (int i = 0; i < ias.length; i++) {
listen(i, hints, ias[i]);
}
int i = 0;
while (!accept(i) && !closeRq) {
i = (i + 1) % ias.length;
try {
Thread.sleep(ACCEPT_RETRY_PERIOD);
} catch (InterruptedException e) {
throw new InterruptedIOException(
"Operation was interrupted.");
}
}
if (closeRq) {
throw new IOException("Connection was closed.");
}
IrNativeConnection conn = new IrNativeConnection();
passPeer(conn);
return conn;
} finally {
release();
}
|
public void | close()Interrupts acceptAndOpen() operation.
closeRq = true;
|
private native void | finalize()Native finalizer. Releases all native resources used by this notifier.
|
private static native int | getInvalidDataHandle()Returns an invalid memory handle value to be used during
initialization of instances of this class.
|
private static native int | getInvalidPeerHandle()Returns an invalid connection handle value to be used during
initialization of instances of this class.
|
private static native void | initialize()Native class initializer.
|
private native void | listen(int index, int hints, java.lang.String ias)Allocates native connection resource for listening with specified
hint bits and IAS set.
|
private native void | passPeer(IrNativeConnection conn)Passes ownership of the native peer handle to the IrNativeConnection
object. peer is set to -1 after calling this
method.
|
private native void | release()Releases native resources.
|