|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectp2ps.imp.endpoint.TCP.TCPInputEndpoint
A class that acts as a wrapper for multiple TCP input socket.
| Nested Class Summary | |
class |
TCPInputEndpoint.TCPServerSocketThread
|
| Field Summary |
| Fields inherited from interface p2ps.imp.endpoint.TCP.TCPEndpointSchemes |
TCP_STANDARD |
| Constructor Summary | |
TCPInputEndpoint(java.lang.String scheme,
int port,
MessageProtocolHandlerFactory factory)
Creates a standard TCP socket for the specified scheme/port |
|
TCPInputEndpoint(java.lang.String scheme,
int port,
MessageProtocolHandlerFactory factory,
java.util.Map properties)
Creates a standard TCP socket for the specified scheme/port |
|
TCPInputEndpoint(java.lang.String scheme,
MessageProtocolHandlerFactory factory)
Creates a standard UDP socket for an available port |
|
TCPInputEndpoint(java.lang.String scheme,
MessageProtocolHandlerFactory factory,
java.util.Map properties)
Creates a standard UDP socket for an available port |
|
| Method Summary | |
void |
addEndpointMessageListener(EndpointMessageListener listener)
Adds a data message listener to the specified pipe |
void |
addServerEndpointListener(ServerEndpointListener listener)
Add a listener to be notified when new connections are opened. |
void |
close()
Closes the socket |
protected ServerSocket |
createServerSocket(java.net.SocketAddress addr,
java.util.Map properties)
|
void |
dataMessageReceived(DataMessageEvent event)
Called when the endpoint receives a data message |
java.net.URI |
getEndpointURI()
|
java.net.URI |
getSendURI()
|
void |
init()
initializes the endpoint |
boolean |
isClosed()
|
boolean |
isInputEndpoint()
|
boolean |
isOutputEndpoint()
|
void |
notifyNewConnectionn(Endpoint replyendpoint)
handle the specified Data Message received on the specified endpoint |
void |
removeEndpointMessageListener(EndpointMessageListener listener)
Removes the specified data message listener from the pipe |
void |
removeServerEndpointListener(ServerEndpointListener listener)
Remove a server endpoint listener. |
void |
send(byte[] message)
Send a message from the socket |
void |
send(java.lang.String sendid,
byte[] message)
Sends a message from the endpoint to the address the endpoint is bound to, along with the send id for this message. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TCPInputEndpoint(java.lang.String scheme,
MessageProtocolHandlerFactory factory)
throws java.io.IOException
public TCPInputEndpoint(java.lang.String scheme,
MessageProtocolHandlerFactory factory,
java.util.Map properties)
throws java.io.IOException
public TCPInputEndpoint(java.lang.String scheme,
int port,
MessageProtocolHandlerFactory factory)
throws java.io.IOException
public TCPInputEndpoint(java.lang.String scheme,
int port,
MessageProtocolHandlerFactory factory,
java.util.Map properties)
throws java.io.IOException
| Method Detail |
protected ServerSocket createServerSocket(java.net.SocketAddress addr,
java.util.Map properties)
throws java.io.IOException
java.io.IOException
public void init()
throws java.io.IOException
init in interface Endpointjava.io.IOExceptionpublic void addEndpointMessageListener(EndpointMessageListener listener)
addEndpointMessageListener in interface Endpointpublic void removeEndpointMessageListener(EndpointMessageListener listener)
removeEndpointMessageListener in interface Endpointpublic void addServerEndpointListener(ServerEndpointListener listener)
addServerEndpointListener in interface ServerEndpointpublic void removeServerEndpointListener(ServerEndpointListener listener)
removeServerEndpointListener in interface ServerEndpointpublic java.net.URI getEndpointURI()
getEndpointURI in interface Endpointpublic java.net.URI getSendURI()
getSendURI in interface Endpointpublic boolean isInputEndpoint()
isInputEndpoint in interface Endpointpublic boolean isOutputEndpoint()
isOutputEndpoint in interface Endpoint
public void send(byte[] message)
throws java.io.IOException
send in interface Endpointjava.io.IOException
public void send(java.lang.String sendid,
byte[] message)
throws java.io.IOException
send in interface Endpointjava.io.IOExceptionpublic void dataMessageReceived(DataMessageEvent event)
dataMessageReceived in interface EndpointMessageListenerpublic void notifyNewConnectionn(Endpoint replyendpoint)
public void close()
throws java.io.IOException
close in interface Endpointjava.io.IOExceptionpublic boolean isClosed()
isClosed in interface Endpointpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||