Package com.example.common.transport
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
-
Method Details
-
getIp
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
Receive a message from the connection.- Returns:
- the received message
- Throws:
IOException
- if an error occurs while receiving the message
-
send
Send a message through the connection.- Parameters:
message
- the message to send- Throws:
IOException
- if an error occurs while sending the message
-
close
Close the connection.- Throws:
IOException
- if an error occurs while closing the connection
-