|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.net.TextServerDaemon
public abstract class TextServerDaemon
A simple TCP/IP server that accepts a text request and sends a text response.
Example script:
daemon = new TextServerDaemon("Example", 8012) {
public String processRequest(String request) {
// just send back request in this example
return "request was " + request;
}
}
Copyright 2008 Partner Software, Inc.
| Constructor Summary | |
|---|---|
TextServerDaemon(java.lang.String name,
int port)
|
|
| Method Summary | |
|---|---|
abstract java.lang.String |
processRequest(java.lang.String request)
Subclasses must implement this to handle incoming requests and generate responses. |
void |
start()
Start the daemon process. |
void |
stop()
Stop the daemon process. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextServerDaemon(java.lang.String name,
int port)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public abstract java.lang.String processRequest(java.lang.String request)
public void start()
throws java.lang.Exception
Daemon
start in interface Daemonjava.lang.Exception
public void stop()
throws java.lang.Exception
Daemon
stop in interface Daemonjava.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||