public interface DmhServerItf
The class DmhServer implements both the DmhClientItf and the DmhServerItf. So all of the usual DMH message sending, receiving and management methods are provided using the DmhClientItf interface definitions. Here we only see additional methods used to support server-only functions.
Modifier and Type | Method and Description |
---|---|
void |
addAlias(String groupname)
Use the uncommon feature of adding a DMH groupname alias so that
sending to mailbox@groupname is recognized as sending
within the server's own DMH group.
|
void |
clientDisconnect(String id)
close the client's socket connection
|
String |
clientIdentify(String id)
ask the client to provide his hostname, command line, and DISPLAY name
as a String result
|
void |
clientPing(String id)
Exercise the network connection which causes an error closure
if the client is gone.
|
void |
clientTerminate(String id)
tell the client to exit, which is honored by Tcl and Java clients,
and by VB clients if the developer codes the Shutdown() callback.
|
String[] |
getAliases()
An alias array is used to implement the concept of
of virtual DMH groups in a single physical server.
|
String |
getMhMsgs(String boxname)
Tcl virtual data mh_msgs.
|
String |
init(int port)
Initialize using a specified socket port number.
|
String |
init(String groupname)
Initialize the DMH server, usually on the default network
interface.
|
String |
lastRead(String boxname)
To support debugging, the DMH server keeps a copy of the last message
sent to each mailbox.
|
DmhLostClientItf |
setLostClient(DmhLostClientItf dlc)
register to receive notification of disconnected clients.
|
DmhReceiveItf |
setTraceMsg(DmhReceiveItf traceReceive)
Register to receive the messages that are sent to the TRACE mailbox.
|
void |
shutdown()
shutdown the listening socket and close all existing client
connections
|
void addAlias(String groupname)
groupname
- void clientDisconnect(String id)
id
- the client handle from the serverStatus listString clientIdentify(String id)
id
- the client handle from the serverStatus listvoid clientPing(String id)
id
- the client handle from the serverStatus listvoid clientTerminate(String id)
id
- the client handle from the serverStatus listString[] getAliases()
String getMhMsgs(String boxname)
"{{hello world message} MY_REPLYBOX} {{sent w/o replybox} {}}"
String init(int port) throws Exception
port
- socket portException
- on failureString init(String groupname) throws Exception
groupname
- the name of the DMH message group.
Group names are usually hashed to an integer
port number. The init() method can also be
called directly with an integer port number.Exception
- on failureString lastRead(String boxname)
DmhLostClientItf setLostClient(DmhLostClientItf dlc)
DmhReceiveItf setTraceMsg(DmhReceiveItf traceReceive)
void shutdown()