|
" 2013 FRC Java API " |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.squawk.io.ConnectionBase
com.sun.squawk.io.j2me.serversocket.Protocol
public class Protocol
StreamConnectionNotifier for Server Socket API.
| Constructor Summary | |
|---|---|
Protocol()
|
|
| Method Summary | |
|---|---|
StreamConnection |
acceptAndOpen()
Returns a GenericConnection that represents a server side socket connection |
void |
close()
Close the connection. |
String |
getLocalAddress()
Gets the local address to which the socket is bound. |
int |
getLocalPort()
Returns the local port to which this socket is bound. |
Connection |
open(String protocol,
String name,
int mode,
boolean timeouts)
Open the connection |
| Methods inherited from class com.sun.squawk.io.ConnectionBase |
|---|
openDataInputStream, openDataOutputStream, openInputStream, openOutputStream |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Protocol()
| Method Detail |
|---|
public Connection open(String protocol,
String name,
int mode,
boolean timeouts)
throws IOException
open in class ConnectionBasename - the target for the connectionmode - a flag that is true if the caller expects to write to the
connection.timeouts - A flag to indicate that the called wants timeout exceptions
The name string for this protocol should be:
"protocol - The URL protocol
IOException
ConnectionNotFoundException - If the connection cannot
be found.
public StreamConnection acceptAndOpen()
throws IOException
acceptAndOpen in interface StreamConnectionNotifierIOException - if an I/O error occurs when creating the
input stream.
public void close()
throws IOException
close in interface Connectionclose in class ConnectionBaseIOException - if an I/O error occurs when closing the
connection.
public String getLocalAddress()
throws IOException
ServerSocketConnectionThe host address(IP number) that can be used to connect to this end of the socket connection from an external system. Since IP addresses may be dynamically assigned, a remote application will need to be robust in the face of IP number reasssignment.
The local hostname (if available) can be accessed from
System.getProperty("microedition.hostname")
getLocalAddress in interface ServerSocketConnectionIOException - if the connection was closedSocketConnection
public int getLocalPort()
throws IOException
ServerSocketConnection
getLocalPort in interface ServerSocketConnectionIOException - if the connection was closedSocketConnection
|
" 2013 FRC Java API " |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||