org.lastbamboo.common.p2p
Interface SocketFactory<T>

All Known Subinterfaces:
P2PClient<T>

public interface SocketFactory<T>

General factory interface for sockets.


Method Summary
 T newRawSocket(URI uri)
          Creates a new socket.
 T newRawUnreliableSocket(URI uri)
          Creates a new "unreliable" socket that, while it uses the Socket interface, does not send packets reliably underneath.
 T newSocket(URI uri)
          Creates a new socket.
 T newUnreliableSocket(URI uri)
          Creates a new "unreliable" socket that, while it uses the Socket interface, does not send packets reliably underneath.
 

Method Detail

newSocket

T newSocket(URI uri)
            throws IOException,
                   org.lastbamboo.common.offer.answer.NoAnswerException
Creates a new socket.

Parameters:
uri - The URI to generate a socket from.
Returns:
The socket.
Throws:
IOException - If there's an error connecting.
org.lastbamboo.common.offer.answer.NoAnswerException - If there's no response from the answerer.

newUnreliableSocket

T newUnreliableSocket(URI uri)
                      throws IOException,
                             org.lastbamboo.common.offer.answer.NoAnswerException
Creates a new "unreliable" socket that, while it uses the Socket interface, does not send packets reliably underneath.

Parameters:
uri - The URI to generate a socket from.
Returns:
The socket.
Throws:
IOException - If there's an error connecting.
org.lastbamboo.common.offer.answer.NoAnswerException - If there's no response from the answerer.

newRawSocket

T newRawSocket(URI uri)
               throws IOException,
                      org.lastbamboo.common.offer.answer.NoAnswerException
Creates a new socket.

Parameters:
uri - The URI to generate a socket from.
Returns:
The socket.
Throws:
IOException - If there's an error connecting.
org.lastbamboo.common.offer.answer.NoAnswerException - If there's no response from the answerer.

newRawUnreliableSocket

T newRawUnreliableSocket(URI uri)
                         throws IOException,
                                org.lastbamboo.common.offer.answer.NoAnswerException
Creates a new "unreliable" socket that, while it uses the Socket interface, does not send packets reliably underneath.

Parameters:
uri - The URI to generate a socket from.
Returns:
The socket.
Throws:
IOException - If there's an error connecting.
org.lastbamboo.common.offer.answer.NoAnswerException - If there's no response from the answerer.


Copyright © 2013 LittleShoot. All Rights Reserved.