public interface TcpConnection
extends java.lang.Runnable
Socket and SocketChannel
that sends Message objects by serializing the payload and streaming it to the
destination. Requires a TcpListener to receive incoming messages.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
java.lang.String |
getConnectionId() |
org.springframework.core.serializer.Deserializer<?> |
getDeserializer() |
java.lang.Object |
getDeserializerStateKey() |
java.lang.String |
getHostAddress() |
java.lang.String |
getHostName() |
TcpListener |
getListener() |
java.lang.Object |
getPayload()
Uses the deserializer to obtain the message payload
from the connection's input stream.
|
int |
getPort() |
org.springframework.core.serializer.Serializer<?> |
getSerializer() |
SocketInfo |
getSocketInfo()
Provides getters for
Socket properties. |
javax.net.ssl.SSLSession |
getSslSession() |
long |
incrementAndGetConnectionSequence() |
boolean |
isOpen() |
boolean |
isServer() |
void |
send(org.springframework.messaging.Message<?> message)
Converts and sends the message.
|
default void |
shutdownInput()
Set the connection's input stream to end of stream.
|
default void |
shutdownOutput()
Disable the socket's output stream.
|
void close()
boolean isOpen()
void send(org.springframework.messaging.Message<?> message)
message - The message,@Nullable java.lang.Object getPayload()
java.lang.String getHostName()
java.lang.String getHostAddress()
int getPort()
java.lang.String getConnectionId()
boolean isServer()
org.springframework.core.serializer.Deserializer<?> getDeserializer()
org.springframework.core.serializer.Serializer<?> getSerializer()
@Nullable TcpListener getListener()
long incrementAndGetConnectionSequence()
@Nullable java.lang.Object getDeserializerStateKey()
Deserializer that
maintains state for this connection. Currently, this would be the InputStream
associated with the connection, but the object should be treated as opaque
and ONLY used as a key.@Nullable javax.net.ssl.SSLSession getSslSession()
SSLSession associated with this connection, if SSL is in use,
null otherwise.SocketInfo getSocketInfo()
Socket properties.default void shutdownInput()
throws java.io.IOException
java.io.IOException - an IO Exception.default void shutdownOutput()
throws java.io.IOException
java.io.IOException - an IO Exception