|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.bluesock.bluemud.driver.SocketCommunicator
This communicator abstracts the User object (which encapsulates a user on the mud) from the actual telnet connection they have. SocketCommunicator handles Telnet socket connections. It acts like a scaled down telnet daemon in that it handles telnet options and responds to them as specified in the telnet protocol RFC. It also handles building InputEvents and enqueueing them in the engine.
Fields inherited from class java.lang.Thread |
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals |
Constructor Summary | |
(package private) |
SocketCommunicator(java.net.Socket connectedSocket)
Constructor. |
Method Summary | |
(package private) void |
characterMode()
Switches the socket into character mode. |
void |
disconnect()
Handles disconnection of the socket. |
(package private) void |
echoOff()
Turns echo off for the client. |
(package private) void |
echoOn()
Turns echo on for the client. |
void |
flush()
Forces a flush on the output stream. |
(package private) java.util.HashMap |
getProperties()
Returns a copy of the properties hashmap for us to dump/view. |
(package private) java.lang.Object |
getProperty(java.lang.String key)
Retrieves information from the properties HashMap. |
(package private) java.lang.Object |
getProperty(java.lang.String key,
java.lang.Object def)
Retrieves information from the properties HashMap and if it's not there, it returns the default. |
void |
initializeSocketCommunicator(User user)
Initializes properties. |
boolean |
inLineMode()
|
(package private) void |
lineMode()
Switches this socket into line mode. |
void |
print(java.lang.String message)
Prints a string to the output stream after converting LF to CRLF. |
void |
print(User user,
java.lang.String message)
Prints a string to the output stream after converting LF to CRLF. |
void |
rawprint(char message)
Prints a string raw to the output stream--no conversions. |
void |
rawprint(char[] message)
Prints a string raw to the output stream--no conversions. |
void |
rawprint(User user,
java.lang.String message)
Prints a string raw to the output stream--no conversions. |
void |
run()
Handles reading lines from the input stream. |
void |
setShouldExit(boolean b)
If the boolean passed in is a true, this will stop the network thread reading for this User. |
(package private) void |
sgaOff()
|
(package private) void |
sgaOn()
|
(package private) boolean |
supports(User user,
java.lang.String property)
The SocketCommunicator knows about what the thing on the other end of this socket supports. |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
SocketCommunicator(java.net.Socket connectedSocket)
connectedSocket
- the Socket that we're wrapping around.Method Detail |
public void initializeSocketCommunicator(User user)
user
- the User object that is associated with this
SocketConnector.public void disconnect()
public void print(User user, java.lang.String message)
user
- the user object that we're sending data to--currently
we don't use this for anything, but we might need
to check the user for properties later on.message
- the outgoing message.public void rawprint(User user, java.lang.String message)
user
- the user object that we're sending data to--currently
we don't use this for anything, but we might need
to check the user for properties later on.message
- the outgoing message.public void print(java.lang.String message)
message
- the outgoing datapublic void rawprint(char[] message)
message
- the outgoing datapublic void rawprint(char message)
message
- the outgoing datapublic void flush()
public void setShouldExit(boolean b)
b
- What to set shouldExit flag to.public void run()
run
in class java.lang.Thread
void echoOn()
void echoOff()
void sgaOn()
void sgaOff()
void lineMode()
void characterMode()
public boolean inLineMode()
boolean supports(User user, java.lang.String property)
user
- The user object (we techically don't need this i think).property
- The property to check to see if their terminal type
supports it.java.lang.Object getProperty(java.lang.String key)
key
- The key of the property to retrieve.java.lang.Object getProperty(java.lang.String key, java.lang.Object def)
key
- The key of the property to retrieve.def
- The default value to return if the the key isn't there.java.util.HashMap getProperties()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |