public class SoupBinTCPClient extends SoupBinTCPSession
Constructor and Description |
---|
SoupBinTCPClient(Clock clock,
SocketChannel channel,
int maxPayloadLength,
MessageListener listener,
SoupBinTCPClientStatusListener statusListener)
Create a client.
|
SoupBinTCPClient(SocketChannel channel,
int maxPayloadLength,
MessageListener listener,
SoupBinTCPClientStatusListener statusListener)
Create a client.
|
SoupBinTCPClient(SocketChannel channel,
MessageListener listener,
SoupBinTCPClientStatusListener statusListener)
Create a client.
|
Modifier and Type | Method and Description |
---|---|
void |
login(SoupBinTCP.LoginRequest payload)
Send a Login Request packet.
|
void |
logout()
Send a Logout Request packet.
|
void |
send(ByteBuffer buffer)
Send an Unsequenced Data packet.
|
close, getChannel, keepAlive, receive
public SoupBinTCPClient(SocketChannel channel, MessageListener listener, SoupBinTCPClientStatusListener statusListener)
channel
- the underlying socket channellistener
- the inbound message listenerstatusListener
- the inbound status event listenerpublic SoupBinTCPClient(SocketChannel channel, int maxPayloadLength, MessageListener listener, SoupBinTCPClientStatusListener statusListener)
channel
- the underlying socket channelmaxPayloadLength
- maximum inbound message lengthlistener
- the inbound message listenerstatusListener
- the inbound status event listenerpublic SoupBinTCPClient(Clock clock, SocketChannel channel, int maxPayloadLength, MessageListener listener, SoupBinTCPClientStatusListener statusListener)
clock
- a clockchannel
- the underlying socket channelmaxPayloadLength
- maximum inbound message lengthlistener
- the inbound message listenerstatusListener
- the inbound status event listenerpublic void login(SoupBinTCP.LoginRequest payload) throws IOException
payload
- the packet payloadIOException
- if an I/O error occurspublic void logout() throws IOException
IOException
- if an I/O error occurspublic void send(ByteBuffer buffer) throws IOException
buffer
- a buffer containing the packet payloadIOException
- if an I/O error occursCopyright © 2017. All rights reserved.