|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.lukasfeiler.tcpserver.TCPSocket
| Field Summary | |
protected java.io.InputStream |
in
|
protected java.io.OutputStream |
out
|
protected TCPServer |
server
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
protected |
TCPSocket(java.net.Socket s,
java.lang.Integer socketId,
TCPServer server,
int connectionTimeout)
Creates a new instance of TCPSocket. |
| Method Summary | |
void |
close()
|
java.lang.String |
getFullName()
Returns a String that contains all relavant information about this socket. |
java.lang.String |
getIP()
Returns the Internet Protocol Address of the client this socket serves. |
java.lang.String |
getLocalIP()
Returns the Internet Protocol Address this client connected to. |
java.lang.String |
getLocalPort()
Returns the port number this client connected to. |
java.io.OutputStream |
getOut()
|
java.lang.String |
getPort()
Returns the port number of the client this socket serves. |
TCPServer |
getServer()
Returns the TCPServer object that is connected to this socket. |
java.lang.Integer |
getSocketId()
Returns the ID of this socket. |
long |
getStartTimeInMillis()
|
void |
print(java.lang.String s)
|
void |
println(java.lang.String s)
Sends the String to the output PrintWriter connected to this socket. |
protected boolean |
processInput()
Processes the input and returns false if the socket is to be closed. |
java.lang.String |
readLine()
|
void |
remove()
|
void |
run()
Starts everything off. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.io.InputStream in
protected TCPServer server
protected java.io.OutputStream out
| Constructor Detail |
protected TCPSocket(java.net.Socket s,
java.lang.Integer socketId,
TCPServer server,
int connectionTimeout)
throws java.io.IOException
s - An instance of TCPSocket.socketId - The ID of this TCPSocket.| Method Detail |
public long getStartTimeInMillis()
public java.lang.String getFullName()
public void println(java.lang.String s)
throws java.io.IOException
s - the String to send.
java.io.IOException
public void print(java.lang.String s)
throws java.io.IOException
java.io.IOException
public java.lang.String readLine()
throws java.io.IOException,
TCPSocketEndOfStreamException
java.io.IOException
TCPSocketEndOfStreamExceptionpublic java.lang.String getIP()
public java.lang.String getPort()
public java.lang.String getLocalIP()
public java.lang.String getLocalPort()
public TCPServer getServer()
public java.lang.Integer getSocketId()
public void close()
throws java.io.IOException
java.io.IOExceptionpublic void remove()
public void run()
protected boolean processInput()
throws java.io.IOException,
TCPSocketEndOfStreamException
java.io.IOException
TCPSocketEndOfStreamExceptionpublic java.io.OutputStream getOut()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||