Interface TransportFactory

All Known Implementing Classes:
TcpSocketTransportFactory

public interface TransportFactory
The TransportFactory interface defines methods for creating transport listeners and connections.
  • Method Summary

    Modifier and Type
    Method
    Description
    createConnection(String ip, int port, String encoding)
    Create a transport connection to the specified IP address and port with the given encoding.
    createListener(int port, int maxCountConnections, String encoding)
    Create a transport listener that listens on the specified port with the given maximum count of connections.
  • Method Details

    • createListener

      TransportListener createListener(int port, int maxCountConnections, String encoding) throws IOException
      Create a transport listener that listens on the specified port with the given maximum count of connections.
      Parameters:
      port - the port number to listen on
      maxCountConnections - the maximum number of connections allowed
      encoding - the encoding used for communication
      Returns:
      a TransportListener object
      Throws:
      IOException - if an error occurs during creation
    • createConnection

      TransportConnection createConnection(String ip, int port, String encoding) throws IOException
      Create a transport connection to the specified IP address and port with the given encoding.
      Parameters:
      ip - the IP address to connect to
      port - the port number to connect to
      encoding - the encoding used for communication
      Returns:
      a TransportConnection object
      Throws:
      IOException - if an error occurs during creation