p2ps.imp.endpoint.UDP
Class UDPOutputEndpoint
java.lang.Object
p2ps.imp.endpoint.UDP.UDPEndpoint
p2ps.imp.endpoint.UDP.UDPOutputEndpoint
- All Implemented Interfaces:
- Endpoint, UDPEndpointSchemes
- public class UDPOutputEndpoint
- extends UDPEndpoint
An extension to UDPEndpoint that connects to a specfied endpoint address + port
and always sends to that endpoint.
- Version:
- $Revision: 295 $
- Author:
- Ian Wang
|
Method Summary |
void |
connect(java.net.SocketAddress address)
Connects the socket to the specified address |
void |
connect(java.lang.String address,
int port)
Connects the socket to the specified address |
java.net.URI |
getSendURI()
|
boolean |
isOutputEndpoint()
|
void |
send(byte[] message)
Sends a message from the endpoint to the address the endpoint is bound
to, with no sendid. |
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. |
| Methods inherited from class p2ps.imp.endpoint.UDP.UDPEndpoint |
addEndpointMessageListener, close, getEndpointURI, getSocket, handleMessage, init, initSocket, isClosed, isInputEndpoint, removeEndpointMessageListener, send, send |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UDPOutputEndpoint
public UDPOutputEndpoint()
throws java.io.IOException
UDPOutputEndpoint
public UDPOutputEndpoint(int port)
throws java.io.IOException
UDPOutputEndpoint
public UDPOutputEndpoint(UDPEndpoint endpoint)
getSendURI
public java.net.URI getSendURI()
- Specified by:
getSendURI in interface Endpoint- Overrides:
getSendURI in class UDPEndpoint
- Returns:
- the address being sent to by this endpoint (if known)
isOutputEndpoint
public boolean isOutputEndpoint()
- Specified by:
isOutputEndpoint in interface Endpoint- Overrides:
isOutputEndpoint in class UDPEndpoint
- Returns:
- true if this endpoint is output enabled
connect
public void connect(java.lang.String address,
int port)
- Connects the socket to the specified address
connect
public void connect(java.net.SocketAddress address)
- Connects the socket to the specified address
send
public void send(byte[] message)
throws java.io.IOException
- Sends a message from the endpoint to the address the endpoint is bound
to, with no sendid.
- Specified by:
send in interface Endpoint- Overrides:
send in class UDPEndpoint
- Throws:
java.io.IOException
send
public void send(java.lang.String sendid,
byte[] message)
throws java.io.IOException
- Sends a message from the endpoint to the address the endpoint is bound
to, along with the send id for this message.
- Specified by:
send in interface Endpoint- Overrides:
send in class UDPEndpoint
- Throws:
java.io.IOException