forked from I2P_Developers/i2p.i2p
<http://dev.i2p.net/pipermail/i2p/2004-April/000214.html>; * slightly revised locking; * made accept() throw a ConnectException when the I2PServerSocket is closed. (human)
35 lines
1007 B
Java
35 lines
1007 B
Java
package net.i2p.client.streaming;
|
|
|
|
import java.net.ConnectException;
|
|
|
|
import net.i2p.I2PException;
|
|
|
|
/**
|
|
* Defines how to listen for streaming peer connections
|
|
*
|
|
*/
|
|
public interface I2PServerSocket {
|
|
/**
|
|
* Closes the socket.
|
|
*/
|
|
public void close() throws I2PException;
|
|
|
|
/**
|
|
* Waits for the next socket connecting. If a remote user tried to make a
|
|
* connection and the local application wasn't .accept()ing new connections,
|
|
* they should get refused (if .accept() doesnt occur in some small period)
|
|
*
|
|
* @return a connected I2PSocket
|
|
*
|
|
* @throws I2PException if there is a problem with reading a new socket
|
|
* from the data available (aka the I2PSession closed, etc)
|
|
* @throws ConnectException if the I2PServerSocket is closed
|
|
*/
|
|
public I2PSocket accept() throws I2PException, ConnectException;
|
|
|
|
/**
|
|
* Access the manager which is coordinating the server socket
|
|
*/
|
|
public I2PSocketManager getManager();
|
|
}
|