Package var.sockets.tcp.echo
Class EchoServerThreadPool.EchoThread
- java.lang.Object
-
- var.sockets.tcp.echo.EchoServerThreadPool.EchoThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- EchoServerThreadPool
private class EchoServerThreadPool.EchoThread extends java.lang.Object implements java.lang.Runnable
Each connection is handled with an instance of this class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.Socket
socket
TCP connection to client
-
Constructor Summary
Constructors Constructor Description EchoThread(java.net.Socket socket)
the only constructor for this class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
run()
defines the behavior of this Thread instance, will be executed concurrently if start() is called on instance
-
-
-
Field Detail
-
socket
private final java.net.Socket socket
TCP connection to client
-
-
Constructor Detail
-
EchoThread
public EchoThread(java.net.Socket socket)
the only constructor for this class- Parameters:
socket
- the individual socket that the server created on accepting a client that this EchoThread instance will be communicating with
-
-
Method Detail
-
run
public void run()
defines the behavior of this Thread instance, will be executed concurrently if start() is called on instance- Specified by:
run
in interfacejava.lang.Runnable
-
-