|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.squawk.io.mailboxes.ServerChannel
public class ServerChannel
Given that a Channel is a one-to-one connection between two isolates, a ServerChannel
provides a factory to create new Channels by name. It is similar to how network sockets
can use a port umber to accept a number of client connections.
A server can use a the accept method to accept new client connections, which will return a new Channel
that the server can use to talk to the client. A server may choose to service each Channel in a seperate thread.
| Method Summary | |
|---|---|
Channel |
accept()
Wait for a client to open a connection, then create an anonymous local mailbox to use or further communication. |
void |
close()
Unregisters this ServerChannel and it's MailBox. |
static ServerChannel |
create(String name)
Creates a new ServerChannel and new Mailbox with the given name and registers it with the system. |
String |
getName()
Get the name that this ServerChannel was registered under. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ServerChannel create(String name)
throws MailboxInUseException
name - the name that this Mailbox can be looked up under.handler - the class used to manage clients opening and closing new logical connections to the new Mailbox.
MailboxInUseException - if there is already a mailbox registered under the name name.public String getName()
public Channel accept()
public void close()
|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||