Node
- the type of node at the remote endpoint.public class HandshakeComposite<Node extends RemoteNode<Node>> extends java.lang.Object implements Protocol<Node>
Constructor and Description |
---|
HandshakeComposite(Protocol<Node>... protocols) |
Modifier and Type | Method and Description |
---|---|
ShakenSocket<Node> |
initiate(Node node,
java.net.Socket s)
Initiates a handshake with a remote host at the given address.
|
ShakenSocket<RemoteWorker> |
receive(java.net.Socket s)
Receives a handshake via the given socket.
|
public ShakenSocket<Node> initiate(Node node, java.net.Socket s) throws java.io.IOException
Protocol
initiate
in interface Protocol<Node extends RemoteNode<Node>>
node
- the remote node to connect to.s
- the socket on which to initiate a handshake.java.io.IOException
public ShakenSocket<RemoteWorker> receive(java.net.Socket s) throws java.io.IOException
Protocol
receive
in interface Protocol<Node extends RemoteNode<Node>>
s
- the socket on which to receive a handshake.java.io.IOException