Class wb.Listen
All Packages Class Hierarchy This Package Previous Next Index
Class wb.Listen
java.lang.Object
|
+----wb.Listen
- public class Listen
- extends Object
- implements Runnable, GTypes
Listen does the work of listening to the master socket and then
starts off a new thread "ProcessClient" to process the response
-
Listen(WBCanvas, Participants)
- Creates an instance of the server thread at the default port (WBPORT)
tries to create a server socket.
-
Listen(WBCanvas, Participants, int)
- Creates an instance of the server thread at the specifed port
-
destroy()
- does the clean up before destroy'g the current thread
-
join()
- provided to support the thread interface.
-
run()
- Infinitely waits on the accept call of the server socket and spawns a
new thread to handle the connection.
-
start()
- Creates a Thread with max priority.
-
stop()
- Stops the current thread and cleans up the sockets
Listen
public Listen(WBCanvas canvas,
Participants party) throws IOException
- Creates an instance of the server thread at the default port (WBPORT)
tries to create a server socket. This is the best time to verify
if the user can continue. Hence, failure in socket creation would throw
an exception for the user to respond appropriately
- Parameters:
- canvas - the WBCanvas on to which the read data is rendered
- party - the Participants in the current session
- Throws: IOException
- if the server socket is already bound
Listen
public Listen(WBCanvas canvas,
Participants party,
int port) throws IOException
- Creates an instance of the server thread at the specifed port
- Parameters:
- canvas - the WBCanvas on to which the read data is rendered
- party - the Participants in the current session
- port - int to identify the port number
- Throws: IOException
- if the server socket is already bound
destroy
public void destroy()
- does the clean up before destroy'g the current thread
start
public void start()
- Creates a Thread with max priority. may be a normal priority would do
stop
public void stop()
- Stops the current thread and cleans up the sockets
join
public final void join() throws InterruptedException
- provided to support the thread interface. Actually does nothing
but to clean up the current thread.
run
public void run()
- Infinitely waits on the accept call of the server socket and spawns a
new thread to handle the connection.
All Packages Class Hierarchy This Package Previous Next Index