Crossfire JXClient, Trunk
|
Go to the documentation of this file.
41 import java.nio.ByteBuffer;
42 import java.nio.channels.CompletionHandler;
67 client.read(
new CompletionHandler<Integer, ByteBuffer>() {
69 public void completed(Integer
result, ByteBuffer buffer) {
73 System.out.println(
"Closing connection to " +
client);
83 public void failed(Throwable exc, ByteBuffer buffer) {
the functions do not always return the right values for PostScript fonts There are still some bugs around the error handling Most of these problems will usually get fixed when some parameters are or the screen is refreshed Many fonts on Solaris fails to retrieve outlines and as the result
final ChatServer chatServer
boolean acceptsMessages()
void onData(Client client, ByteBuffer buffer, int bytes)
boolean acceptsMessages()
A Simple Chat Server Example the server takes input from a it handles the startup and handles incoming connections on the listening sockets It keeps a list of connected client and provides methods for sending a message to them Client represents a connected it provides methods for reading writing from to the underlying socket It also contains a buffer of input read from the user DataReader provides the interface of the two states a user can be in Waiting for a it sends the user a string and waits for a response before changing the state to MessageReader MessageReader is the main state for a client
void removeClient(Client client)
void run(final Client client)
void beforeRead(Client client)
ClientReader(ChatServer chatServer, DataReader callback)
final DataReader callback