|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object netP5.AbstractTcpServer
public abstract class AbstractTcpServer
Field Summary | |
---|---|
static int |
MODE_NEWLINE
|
static int |
MODE_READLINE
|
static int |
MODE_STREAM
|
static int |
MODE_TERMINATED
|
Constructor Summary | |
---|---|
AbstractTcpServer(int thePort,
int theMode)
|
|
AbstractTcpServer(TcpPacketListener theTcpPacketListener,
int thePort,
int theMode)
|
Method Summary | |
---|---|
void |
ban(String theIP)
ban an IP address from the server. |
void |
dispose()
kill the server. |
TcpClient |
getClient(int theIndex)
get a client at a specific position the client list. |
TcpClient[] |
getClients()
get a list of all connected clients. |
abstract void |
handleInput(TcpPacket thePacket,
int thePort)
|
void |
process(TcpPacket thePacket,
int thePort)
|
void |
remove(AbstractTcpClient theTcpClient)
remove a TcpClient from the server's client list. |
void |
run()
|
void |
send(byte[] theBytes)
send a byte array to the connected client(s). |
void |
send(String theString)
send a string to the connected client(s). |
int |
size()
get the number of connected clients. |
ServerSocket |
socket()
get the server socket object. |
void |
unBan(String theIP)
remove the ban for an IP address. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface netP5.TcpPacketListener |
---|
status |
Field Detail |
---|
public static final int MODE_READLINE
public static final int MODE_TERMINATED
public static final int MODE_NEWLINE
public static final int MODE_STREAM
Constructor Detail |
---|
public AbstractTcpServer(int thePort, int theMode)
thePort
- inttheMode
- intpublic AbstractTcpServer(TcpPacketListener theTcpPacketListener, int thePort, int theMode)
theTcpPacketListener
- TcpPacketListenerthePort
- inttheMode
- intMethod Detail |
---|
public void ban(String theIP)
theIP
- public void unBan(String theIP)
theIP
- public ServerSocket socket()
public void run()
run
in interface Runnable
public void send(String theString)
theString
- public void send(byte[] theBytes)
theBytes
- public void dispose()
public int size()
public TcpClient[] getClients()
public TcpClient getClient(int theIndex)
theIndex
-
public void process(TcpPacket thePacket, int thePort)
process
in interface TcpPacketListener
thePacket
- TcpPacketthePort
- intpublic abstract void handleInput(TcpPacket thePacket, int thePort)
thePacket
- TcpPacketthePort
- intpublic void remove(AbstractTcpClient theTcpClient)
remove
in interface TcpPacketListener
theTcpClient
- TCPClientAbstract
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |