public class FS4Connection extends Object implements com.yahoo.io.Connection
Constructor and Description |
---|
FS4Connection(SocketChannel channel,
com.yahoo.io.Listener listener,
Backend backend,
PacketListener packetListener)
Create an FS4 Connection.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
This is called when we close the connection to do any
pending cleanup work.
|
void |
connect()
Upon asynchronous connect completion this method is called by
the Listener.
|
boolean |
isValid()
This method is used to determine whether the connection is still
viable or not.
|
void |
read() |
int |
selectOps()
Since we are performing an asynchronous connect we are initially
only interested in the
OP_CONNECT event. |
void |
sendPacket(BasicPacket packet,
Integer channelId)
Packet sending interface.
|
SocketChannel |
socketChannel()
Return the underlying SocketChannel used by this connection.
|
String |
toString() |
void |
write()
The write event handler.
|
public FS4Connection(SocketChannel channel, com.yahoo.io.Listener listener, Backend backend, PacketListener packetListener)
public void sendPacket(BasicPacket packet, Integer channelId) throws IOException
IOException
public void write() throws IOException
write
in interface com.yahoo.io.Connection
IOException
public void read() throws IOException
read
in interface com.yahoo.io.Connection
IOException
public void close() throws IOException
close
in interface com.yahoo.io.Connection
IOException
public void connect() throws IOException
connect
in interface com.yahoo.io.Connection
IOException
public int selectOps()
OP_CONNECT
event.selectOps
in interface com.yahoo.io.Connection
public SocketChannel socketChannel()
socketChannel
in interface com.yahoo.io.Connection
public boolean isValid()
Copyright © 2018. All rights reserved.