|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--kom.tools.ipc.IPCServer
A network server. Once started, the server listens for incoming connections, accepts them and then handles them. The handle method must be overriden in subclasses.
Field Summary | |
int |
port
Port number for listening (default 80) |
protected java.net.ServerSocket |
socket
Socket for incoming connections |
Fields inherited from class java.lang.Thread |
contextClassLoader,
daemon,
eetop,
group,
inheritedAccessControlContext,
MAX_PRIORITY,
MIN_PRIORITY,
name,
NORM_PRIORITY,
priority,
single_step,
stillborn,
stopThreadPermission,
target,
threadInitNumber,
threadQ,
values |
Constructor Summary | |
IPCServer()
default class constructor |
|
IPCServer(int p)
Class constructor |
Method Summary | |
protected IPCConnection |
accept()
Waits for a connection (blocks until a client tries to connect) |
protected boolean |
bind()
Binds the server to the specified port |
void |
handle(IPCConnection connection)
This is a deferred method for handling an incoming connection. |
void |
run()
Overriden method. |
void |
start()
Starts a thread (overriden method). |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public int port
protected java.net.ServerSocket socket
Constructor Detail |
public IPCServer()
public IPCServer(int p)
p
- the port number for listeningMethod Detail |
protected IPCConnection accept()
protected boolean bind()
public void start()
public void run()
public void handle(IPCConnection connection)
connection
- the incoming connection from the client
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |