|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object OEM com.motorola.oem.ipd.LocalSocketManager
public class LocalSocketManager
Local sockets managment.
getRemoteAddress()
method.getListenPort()
method.
// Retrieve the local listen port
int localPortId = LocalSocketManager.getListenPort();
// open TCP server local socket
ServerSocketConnection ssc = (ServerSocketConnection)Connector.open("socket://:"+localPortId);
IpDirectorAvailabilityListener
Field Summary | |
---|---|
static int |
IPD_STATE_ACTIVE
IP Director service is ready for use. |
static int |
IPD_STATE_INACTIVE
IP Director service is not available. |
Method Summary | |
---|---|
static int |
getIpdState()
Get the current IP Director service availability state. |
static int |
getListenPort()
Gets the local listen socket fixed port id. |
static java.lang.String |
getOwnAddress()
Gets the Local Socket own fixed IP. |
static java.lang.String |
getRemoteAddress()
Gets the Local Socket remote fixed IP. |
static void |
setIpDirectorListener(IpDirectorAvailabilityListener listener)
Sets the listener for IP Director state changed event. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IPD_STATE_INACTIVE
Any opened local socket must be closed.
IpDirectorAvailabilityListener.onIpdStateChanged(int)
,
IPD_STATE_ACTIVE
,
Constant Field Valuespublic static final int IPD_STATE_ACTIVE
local socket(s) can be opened
IpDirectorAvailabilityListener.onIpdStateChanged(int)
,
IPD_STATE_INACTIVE
,
Constant Field ValuesMethod Detail |
---|
public static final int getIpdState()
IPD_STATE_INACTIVE
,
IPD_STATE_ACTIVE
IpDirectorAvailabilityListener.onIpdStateChanged(int)
public static java.lang.String getRemoteAddress()
That is, external device's preset IP address, as configured by AT+MIAU command.
// UDP
UDPDatagramConnection dc = (UDPDatagramConnection)Connector.open("datagram://"+LocalSocketManager.getRemoteAddress()+":"+anyPortId);
// TCP
SocketConnection ssc = (SocketConnection)Connector.open("socket://"+LocalSocketManager.getRemoteAddress()+":"+anyPortId);
public static java.lang.String getOwnAddress()
That is, MIDlet's preset local IP address, as configured by the External device (see device User Guide).
public static int getListenPort()
That is, MIDlet's preset local port, as configured by the External device (see device User Guide). This port id may be used for TCP/UDP socket(s) opening in server mode.
// Retrieve the listen port
int localPortId = LocalSocketManager.getListenPort();
// UDP
UDPDatagramConnection dc = (UDPDatagramConnection)Connector.open("datagram://:"+localPortId);
// TCP
ServerSocketConnection ssc = (ServerSocketConnection)Connector.open("socket://:"+localPortId);
public static void setIpDirectorListener(IpDirectorAvailabilityListener listener)
User can reconfigure existing listener at any time. Note: Setting a null listener will cancle the listening on IP Director events.
listener
- External listener object to receive the event.IpDirectorAvailabilityListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |