22 package com.realtime.crossfire.jxclient.server.server;
28 import java.io.IOException;
29 import org.jetbrains.annotations.NotNull;
30 import org.jetbrains.annotations.Nullable;
68 public void stop() throws InterruptedException {
95 public void writePacket(@NotNull
final byte[] packet,
final int length) {
103 public void connect(@NotNull
final String hostname,
final int port) {
104 clientSocket.
connect(hostname, port);
void writePacket(@NotNull final byte[] packet, final int length)
Writes a Crossfire Message on the socket, so it is sent to the server.
Performs most of the network-related work.
void start()
Starts operation.
void start()
Starts operation.
void disconnect(@NotNull final String reason, final boolean isError)
Terminates the connection.
void stop()
Stops operation.
void addClientSocketListener(@NotNull final ClientSocketListener clientSocketListener)
Adds a ClientSocketListener to be notified.
Writer debug information to a log file.
One of the two most important classes, ServerConnection performs most of the network-related work...
Combines all model classes that are updated.
void disconnect(@NotNull final String reason)
Disconnects from the server.Does nothing if not connected. the reason for the disconnect ...
A socket that processes incoming data.
void removeClientSocketListener(@NotNull final ClientSocketListener clientSocketListener)
Removes a ClientSocketListener to notify.the client socket listener to remove
Interface for listeners interested in ClientSocket related events.
void writePacket(@NotNull final byte[] buf, final int len)
Writes a packet.
void connect(@NotNull final String host, final int port)
Connects to a server.
void addClientSocketListener(@NotNull final ClientSocketListener clientSocketListener)
Adds a ClientSocketListener to notify.the client socket listener to add
DefaultServerConnection(@NotNull final Model model, @Nullable final DebugWriter debugProtocol)
Creates a new instance.
void removeClientSocketListener(@NotNull final ClientSocketListener clientSocketListener)
Removes a ClientSocketListener to be notified.
final ClientSocket clientSocket
The ClientSocket instance used to connect to Crossfire servers.
void stop()
Stops operation.
void connect(@NotNull final String hostname, final int port)
Attempts to connect the client to a server.the hostname to connect to the port to connect to ...