C E G H I K M N P R S T

C

close() - Method in class net.zortrium.p2proto.Connection
Close the connection and all internal streams.
close() - Method in class net.zortrium.p2proto.PeerListener
Shuts down the listener.
Connection - Class in net.zortrium.p2proto
A connection to send messages to a remote peer.
Connection(InetAddress, int) - Constructor for class net.zortrium.p2proto.Connection
Set up the new socket connection to the given host.
Connection(String, int) - Constructor for class net.zortrium.p2proto.Connection
Convenience constructor that calls InetAddress.getByName(String) and passes it to Connection.Connection(InetAddress, int).

E

equals(Object) - Method in class net.zortrium.p2proto.Connection
Two connections are equal if they are connected to the same address on the same port.
equals(Object) - Method in class net.zortrium.p2proto.Msg
Two messages are equal if their type and content are identical.

G

getAddress() - Method in class net.zortrium.p2proto.Connection
Get the remote address of this connection.
getCached(InetAddress, int) - Static method in class net.zortrium.p2proto.Connection
Get a cached connection to the given address and port.
getCached(String, int) - Static method in class net.zortrium.p2proto.Connection
Performs a hostname lookup and calls Connection.getCached(InetAddress, int).
getContent() - Method in class net.zortrium.p2proto.Msg
Get the binary content of the message (or null if the message has no content).
getDefaultTimeout() - Method in class net.zortrium.p2proto.Connection
Get the default timeout (in ms) for receiving response messages.
getErrorMessage() - Method in exception net.zortrium.p2proto.PeerErrorException
Get the content message sent with the error.
getErrorString() - Method in exception net.zortrium.p2proto.PeerErrorException
Get the textual error message sent from the remote host.
getLocalPort() - Method in class net.zortrium.p2proto.PeerListener
Get the port to which the listener is bound.
getPeer() - Method in exception net.zortrium.p2proto.PeerException
Get the host that caused the error.
getPeerAddress() - Method in class net.zortrium.p2proto.MsgResponder
Get the address of the peer from which the request message was received.
getPort() - Method in class net.zortrium.p2proto.Connection
Get the remote port of this connection.
getRequest() - Method in exception net.zortrium.p2proto.PeerException
Get the request message that resulted in the error.
getTimeout() - Method in exception net.zortrium.p2proto.PeerTimeoutException
Get the time (in ms) that the connection waited for a response before timing out.
getType() - Method in class net.zortrium.p2proto.Msg
Get the type of the message.

H

handleException(IOException) - Method in interface net.zortrium.p2proto.MsgCallback
Handle any IO exception encountered while sending the query message.
handleMessage(Msg, MsgResponder) - Method in class net.zortrium.p2proto.PeerListener
Handle the message and possibly send a response or error message.
handlePeerError(PeerErrorException) - Method in interface net.zortrium.p2proto.MsgCallback
Handle an error message response.
handlePeerTimeout(PeerTimeoutException) - Method in interface net.zortrium.p2proto.MsgCallback
Handle a message response timeout.
handleResponse(Msg) - Method in interface net.zortrium.p2proto.MsgCallback
Handle the given response message.
hasContent() - Method in class net.zortrium.p2proto.Msg
Check whether this message contains any content.
hasErrorMessage() - Method in exception net.zortrium.p2proto.PeerErrorException
Check whether the error was sent with a content message (in addition to the simple error string).
hashCode() - Method in class net.zortrium.p2proto.Connection
 
hashCode() - Method in class net.zortrium.p2proto.Msg
 

I

isClosed() - Method in class net.zortrium.p2proto.Connection
Check whether the connection is still active.
isClosed() - Method in class net.zortrium.p2proto.PeerListener
Get whether the listener has been closed.

K

killConnections() - Method in class net.zortrium.p2proto.PeerListener
Immediately closes all connections that are currently open.

M

Msg - Class in net.zortrium.p2proto
The main class representing a message to be sent over the network.
Msg(int, ByteString) - Constructor for class net.zortrium.p2proto.Msg
Construct a new message with the given type and content.
Msg(int) - Constructor for class net.zortrium.p2proto.Msg
Construct a new message with the given type and no content.
Msg(int, byte[]) - Constructor for class net.zortrium.p2proto.Msg
Construct a new message with the given type and binary content.
Msg(int, byte[], int, int) - Constructor for class net.zortrium.p2proto.Msg
Construct a new message with the given type and binary content (of the given size at the given offset).
Msg(int, Message) - Constructor for class net.zortrium.p2proto.Msg
Construct a new message with the given type and the given protocol buffer message as content.
Msg(int, Message.Builder) - Constructor for class net.zortrium.p2proto.Msg
Convenience constructor that builds the given protocol buffer message, then calls Msg.Msg(int, Message).
MsgCallback - Interface in net.zortrium.p2proto
Interface for specifying how to handle the responses of asynchronous messages.
MsgResponder - Class in net.zortrium.p2proto
Class to facilitate sending a response message to a host who previously sent the local host a query message.

N

net.zortrium.p2proto - package net.zortrium.p2proto
P2Proto is a Java RPC library built on top of Protocol Buffers, designed with peer-to-peer (P2P) systems in mind.

P

PeerErrorException - Exception in net.zortrium.p2proto
Exception indicating that a peer encountered an error while processing a request message.
PeerException - Exception in net.zortrium.p2proto
Base class for exceptions resulting from requests sent to remote peers.
PeerException(String, InetAddress, Msg) - Constructor for exception net.zortrium.p2proto.PeerException
Construct a new exception for the given host and query message.
PeerListener - Class in net.zortrium.p2proto
Listens for connections from other hosts, then spawns a thread to handle communication with each connecting host.
PeerListener(int) - Constructor for class net.zortrium.p2proto.PeerListener
Set up a listener for incoming connections on the given port.
PeerListener(int, int) - Constructor for class net.zortrium.p2proto.PeerListener
Set up a listener for incoming connections on the given port.
PeerListener(int, int, InetAddress) - Constructor for class net.zortrium.p2proto.PeerListener
Set up a listener for incoming connections on the given port.
PeerTimeoutException - Exception in net.zortrium.p2proto
Exception indicating that a response message was not received in under the specified time limit.

R

responseRequested() - Method in class net.zortrium.p2proto.MsgResponder
Get whether a response was requested by the sender.
run() - Method in class net.zortrium.p2proto.PeerListener
Listens for incoming connections from other peers.

S

send(Msg) - Method in class net.zortrium.p2proto.Connection
Send a message and do not wait for a response message.
sendAsync(Msg) - Method in class net.zortrium.p2proto.Connection
Send a message asynchronously and disregard any responses received.
sendAsync(Msg, MsgCallback) - Method in class net.zortrium.p2proto.Connection
Send a message asynchronously and disregard any responses received.
sendError(String, Msg) - Method in class net.zortrium.p2proto.MsgResponder
Send an error message to the other host that will raise an exception.
sendError(String) - Method in class net.zortrium.p2proto.MsgResponder
Convenience method that simply calls MsgResponder.sendError(String, Msg) with no content message.
sendRequest(Msg) - Method in class net.zortrium.p2proto.Connection
Send a message and block until either a response message is received or the default timeout has passed.
sendRequest(Msg, long) - Method in class net.zortrium.p2proto.Connection
Send a message and block until either a response message is received or the specified timeout (in ms) has passed.
sendRequestAsync(Msg, MsgCallback) - Method in class net.zortrium.p2proto.Connection
Send a message asynchronously and call the given handler when a response is received, the default timeout has elapsed, or a send error occurs.
sendRequestAsync(Msg, MsgCallback, long) - Method in class net.zortrium.p2proto.Connection
Send a message asynchronously and call the given handler when a response is received, the specified timeout (in ms) has passed, or a send error occurs.
sendResponse(Msg) - Method in class net.zortrium.p2proto.MsgResponder
Send a message to the other host that will be associated as a response to the query message.
setDefaultTimeout(long) - Method in class net.zortrium.p2proto.Connection
Set the default timeout (in ms) for receiving response messages, used by Connection.sendRequest(Msg) and Connection.sendRequestAsync(Msg, MsgCallback) .
setThreadSafety(boolean) - Method in class net.zortrium.p2proto.Connection
Set whether the connection performs internal synchronization on the outgoing message queue.
shutdown() - Method in class net.zortrium.p2proto.PeerListener
Alias for PeerListener.close().

T

toString() - Method in class net.zortrium.p2proto.Connection
 
toString() - Method in class net.zortrium.p2proto.Msg
 
toString() - Method in exception net.zortrium.p2proto.PeerErrorException
 
toString() - Method in exception net.zortrium.p2proto.PeerException
 
toString() - Method in exception net.zortrium.p2proto.PeerTimeoutException
 

C E G H I K M N P R S T