public interface PeerConnection extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
closeQuietly()
Close the connection without throwing an
IOException . |
long |
getLastActive() |
Peer |
getRemotePeer() |
int |
getRemotePort() |
TorrentId |
getTorrentId() |
boolean |
isClosed() |
void |
postMessage(Message message)
Send a message to remote peer.
|
Message |
readMessage(long timeout)
Attempt to read an incoming message within a specified time interval.
|
Message |
readMessageNow()
Attempt to read an incoming message.
|
TorrentId |
setTorrentId(TorrentId torrentId)
Associate this connection with the given torrent ID.
|
Peer getRemotePeer()
int getRemotePort()
TorrentId setTorrentId(TorrentId torrentId)
torrentId
- Torrent ID to associate this connection withTorrentId getTorrentId()
Message readMessageNow() throws IOException
IOException
Message readMessage(long timeout) throws IOException
IOException
void postMessage(Message message) throws IOException
IOException
long getLastActive()
void closeQuietly()
IOException
.boolean isClosed()
Copyright © 2016–2021. All rights reserved.