public class MessageSocket extends C4Socket implements ReplicatorConnection
NO_FRAMING, WEB_SOCKET_CLIENT_FRAMING, WEB_SOCKET_SERVER_FRAMING
Constructor and Description |
---|
MessageSocket(long peer,
MessageEndpoint endpoint) |
MessageSocket(MessageEndpointConnection connection,
ProtocolType protocolType) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
close(MessagingError error)
Tells the replicator to close the current replicator connection.
|
void |
receive(Message message)
Tells the replicator to consume the data received from the other peer.
|
String |
toString() |
public MessageSocket(@NonNull MessageEndpointConnection connection, @NonNull ProtocolType protocolType)
public MessageSocket(long peer, @NonNull MessageEndpoint endpoint)
@NonNull public String toString()
toString
in class C4NativePeer
public void close()
close
in interface AutoCloseable
public final void receive(@NonNull Message message)
ReplicatorConnection
receive
in interface ReplicatorConnection
message
- the messagepublic final void close(@Nullable MessagingError error)
ReplicatorConnection
close
in interface ReplicatorConnection
error
- the error if any