|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--omnisockets.OmniListener
The OmniListener is a server socket that runs itself in a thread, accepts connections, and notifies the application when a connection is made.
OmniSocket,
OmniEventHandler| Constructor Summary | |
OmniListener(int port)
Constructs an OmniListener on the specified port. |
|
OmniListener(int port,
int backlog)
Constructs an OmniListener on the specified port with the specified backlog. |
|
OmniListener(int port,
int backlog,
java.net.InetAddress bindaddr)
Constructs an OmniListener on the specified port with the specified backlog and bindaddr. |
|
OmniListener(int port,
int backlog,
java.net.InetAddress bindaddr,
omnisockets.OmniEventHandler eventHandler)
Constructs an OmniListener on the specified port with the specified backlog and bindaddr. |
|
OmniListener(int port,
int backlog,
omnisockets.OmniEventHandler eventHandler)
Constructs an OmniListener on the specified port with the specified backlog. |
|
OmniListener(int port,
omnisockets.OmniEventHandler eventHandler)
Constructs an OmniListener on the specified port. |
|
| Method Summary | |
omnisockets.OmniSocket |
accept()
Accepts a connection synchronously. |
int |
getBacklog()
Returns the backlog. |
java.net.InetAddress |
getBindAddr()
Returns the bind address. |
omnisockets.OmniEventHandler |
getEventHandler()
Returns the event handler. |
int |
getPort()
Returns the port. |
java.net.ServerSocket |
getRawSocket()
Returns the raw socket. |
java.lang.Thread |
getThread()
Returns the thread. |
boolean |
isValid()
Tests the valid state. |
void |
run()
Accepts connections and notifies the user when a new connection is made. |
void |
setEventHandler(omnisockets.OmniEventHandler eventHandler)
Sets the event handler. |
void |
setName(java.lang.String name)
Sets the listener name. |
void |
setPriority(int priority)
Sets the listener priority. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OmniListener(int port)
throws java.io.IOException
port - the port number to use
public OmniListener(int port,
omnisockets.OmniEventHandler eventHandler)
throws java.io.IOException
port - the port number to useeventHandler - the OmniEventHandler to run
when a conection is established
public OmniListener(int port,
int backlog)
throws java.io.IOException
port - the port number to usebacklog - the maximum number of connections to accept
public OmniListener(int port,
int backlog,
omnisockets.OmniEventHandler eventHandler)
throws java.io.IOException
port - the port number to usebacklog - the maximum number of connections to accepteventHandler - the OmniEventHandler to run
when a conection is established
public OmniListener(int port,
int backlog,
java.net.InetAddress bindaddr)
throws java.io.IOException
port - the port number to usebacklog - the maximum number of connections to acceptbindaddr - the bind address to use, or null
to use the canonical network interface
public OmniListener(int port,
int backlog,
java.net.InetAddress bindaddr,
omnisockets.OmniEventHandler eventHandler)
throws java.io.IOException
port - the port number to usebacklog - the maximum number of connections to acceptbindaddr - the bind address to use, or null
to use the canonical network interfaceeventHandler - the OmniEventHandler to run
when a conection is established| Method Detail |
public void run()
run in interface java.lang.Runnable
public omnisockets.OmniSocket accept()
throws java.io.IOException
java.io.IOExceptionpublic java.net.InetAddress getBindAddr()
public int getPort()
public int getBacklog()
public omnisockets.OmniEventHandler getEventHandler()
public void setEventHandler(omnisockets.OmniEventHandler eventHandler)
eventHandler - an OmniEventHandler object useed
to notify the user of socket eventspublic boolean isValid()
public void setPriority(int priority)
priority - a valid thread prioritypublic void setName(java.lang.String name)
name - a descriptive stringpublic java.lang.Thread getThread()
public java.net.ServerSocket getRawSocket()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||