|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.client.streaming.I2PSocketImpl
class I2PSocketImpl
Initial stub implementation for the socket
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.i2p.client.streaming.I2PSocket |
---|
I2PSocket.SocketErrorListener |
Field Summary | |
---|---|
static int |
MAX_PACKET_SIZE
Deprecated. |
static int |
PACKET_DELAY
Deprecated. |
Constructor Summary | |
---|---|
I2PSocketImpl(Destination peer,
I2PSocketManagerImpl mgr,
boolean outgoing,
String localID)
Deprecated. |
Method Summary | |
---|---|
void |
close()
Deprecated. Closes the socket if not closed yet (from the Application side). |
(package private) void |
errorOccurred()
Deprecated. |
long |
getBytesReceived()
Deprecated. |
long |
getBytesSent()
Deprecated. |
long |
getClosedOn()
Deprecated. |
long |
getCreatedOn()
Deprecated. |
InputStream |
getInputStream()
Deprecated. Return an InputStream to read from the socket. |
String |
getLocalID()
Deprecated. Our half of the socket's unique ID |
I2PSocketOptions |
getOptions()
Deprecated. |
OutputStream |
getOutputStream()
Deprecated. Return an OutputStream to write into the socket. |
Destination |
getPeerDestination()
Deprecated. Return the destination of the peer. |
long |
getReadTimeout()
Deprecated. How long we will wait blocked on a read() operation. |
String |
getRemoteID()
Deprecated. Retrieve the other side's half of the socket's unique ID, or null if it isn't known yet. |
String |
getRemoteID(boolean wait)
Deprecated. Retrieve the other side's half of the socket's unique ID, or null if it isn't known yet |
String |
getRemoteID(boolean wait,
long maxWait)
Deprecated. Retrieve the other side's half of the socket's unique ID, or null if it isn't known yet and we were instructed not to wait |
Destination |
getThisDestination()
Deprecated. Return the Destination of this side of the socket. |
protected void |
internalClose()
Deprecated. Close the socket from the I2P side (by a close packet) |
boolean |
isClosed()
Deprecated. |
void |
queueData(byte[] data)
Deprecated. The other side has given us some data, so inject it into our socket's inputStream |
void |
setOptions(I2PSocketOptions options)
Deprecated. Configure the socket |
void |
setReadTimeout(long ms)
Deprecated. Define how long we will wait blocked on a read() operation (-1 will make the socket wait forever). |
void |
setRemoteID(String id)
Deprecated. We've received the other side's half of the socket's unique ID |
void |
setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)
Deprecated. |
String |
toString()
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_PACKET_SIZE
public static final int PACKET_DELAY
Constructor Detail |
---|
public I2PSocketImpl(Destination peer, I2PSocketManagerImpl mgr, boolean outgoing, String localID)
peer
- who this socket is (or should be) connected tomgr
- how we talk to the networkoutgoing
- did we initiate the connection (true) or did we receive it (false)?localID
- what is our half of the socket ID?Method Detail |
---|
public String getLocalID()
public void setRemoteID(String id)
public String getRemoteID(boolean wait)
wait
- if true, we should wait until we receive it from the peer, otherwise
return what we know immediately (which may be null)public String getRemoteID(boolean wait, long maxWait) throws InterruptedIOException
wait
- should we wait for the peer to send us their half of the ID, or
just return immediately?maxWait
- if we're going to wait, after how long should we timeout and fail?
(if this value is < 0, we wait indefinitely)
InterruptedIOException
- when the max waiting period has been exceededpublic String getRemoteID()
public void queueData(byte[] data)
data
- the data to inject into our local inputStreampublic Destination getThisDestination()
getThisDestination
in interface I2PSocket
public Destination getPeerDestination()
getPeerDestination
in interface I2PSocket
public InputStream getInputStream() throws IOException
getInputStream
in interface I2PSocket
IOException
- on failurepublic OutputStream getOutputStream() throws IOException
getOutputStream
in interface I2PSocket
IOException
- on failurepublic void close() throws IOException
close
in interface I2PSocket
IOException
- on failurepublic boolean isClosed()
isClosed
in interface I2PSocket
protected void internalClose()
public void setOptions(I2PSocketOptions options)
I2PSocket
setOptions
in interface I2PSocket
options
- I2PSocketOptions to setpublic I2PSocketOptions getOptions()
getOptions
in interface I2PSocket
public long getReadTimeout()
getReadTimeout
in interface I2PSocket
public void setReadTimeout(long ms)
setReadTimeout
in interface I2PSocket
ms
- timeout in mspublic void setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)
setSocketErrorListener
in interface I2PSocket
void errorOccurred()
public long getBytesSent()
public long getBytesReceived()
public long getCreatedOn()
public long getClosedOn()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |