|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.ihmc.mockets.StreamServerMocket
public class StreamServerMocket
The ServerMocket class represents an endpoint for mockets that is capable of receiving incoming connections. This class is designed to be a drop-in replacement for the Socket class in the Java Platform API.
Constructor Summary | |
---|---|
StreamServerMocket(int port)
Construct a new server mocket that listens for incoming connections on the specified port. |
|
StreamServerMocket(java.net.SocketAddress sockAddress)
Construct a new server mocket that listens for incoming connections on the specified SocketAddress. |
Method Summary | |
---|---|
StreamMocket |
accept()
Accept a new connection and return an instance of Mocket that represents the local endpoint for the new connection. |
void |
close()
Close the server mocket and no longer accept new incoming connections. |
protected void |
finalize()
|
int |
getLocalPort()
Returns the port on which this socket is listening. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamServerMocket(java.net.SocketAddress sockAddress) throws java.io.IOException
sockAddress
- the address to use.
java.io.IOException
- if the specified port is in use.public StreamServerMocket(int port) throws java.io.IOException
port
- the port number to use.
java.io.IOException
- if the specified port is in use.Method Detail |
---|
public int getLocalPort()
protected void finalize()
finalize
in class java.lang.Object
public StreamMocket accept() throws java.io.IOException
java.io.IOException
- if there was a problem in accepting the connectionpublic void close()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |