Interface TransportConnection

All Known Implementing Classes:
TcpSocketTransportConnection

public interface TransportConnection
The TransportConnection interface defines methods for managing a connection for sending and receiving messages.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Close the connection.
    Get the IP address of the connection.
    Receive a message from the connection.
    void
    send(String message)
    Send a message through the connection.
  • Method Details

    • getIp

      String getIp() throws IOException
      Get the IP address of the connection.
      Returns:
      the IP address of the connection
      Throws:
      IOException - if an error occurs while retrieving the IP address
    • receive

      String receive() throws IOException
      Receive a message from the connection.
      Returns:
      the received message
      Throws:
      IOException - if an error occurs while receiving the message
    • send

      void send(String message) throws IOException
      Send a message through the connection.
      Parameters:
      message - the message to send
      Throws:
      IOException - if an error occurs while sending the message
    • close

      void close() throws IOException
      Close the connection.
      Throws:
      IOException - if an error occurs while closing the connection