com.eyebolt.iplib
Class ListenThread

java.lang.Object
  |
  +--com.eyebolt.iplib.ListenThread
All Implemented Interfaces:
java.lang.Runnable

class ListenThread
extends java.lang.Object
implements java.lang.Runnable

Thread to block on incoming connections.

Version:
0.01, 4 Jan 1997
Author:
John Gardner

Field Summary
static int ERR_PORT_IN_USE
          Error returned by listen when the port is not available
private  IPManager ipmanager
          parent ipmanager
(package private)  boolean keepGoing
          flag to stop the listen
private  IPAddress listenAddress
          address (port) on which to listen
(package private)  java.net.ServerSocket listenSocket
          server socket
static int OK
          Value returned when an operation runs successfully
private  IPCallback onreceive
           
private  int status
          status of the thread
static int SUCCESS
          Value returned when an operation runs successfully
private  java.lang.Thread thread
          actual thread running
 
Constructor Summary
ListenThread(IPAddress address, IPManager ipm, IPCallback cb)
          Constructor - will listen on the given address
 
Method Summary
 IPAddress getAddress()
          return listen address
 int getStatus()
          return status code
 void run()
          Main processing method for the ListenThread object
 void stopListen()
          stop listening
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static final int SUCCESS
Value returned when an operation runs successfully

OK

public static final int OK
Value returned when an operation runs successfully

ERR_PORT_IN_USE

public static final int ERR_PORT_IN_USE
Error returned by listen when the port is not available

listenSocket

java.net.ServerSocket listenSocket
server socket

keepGoing

boolean keepGoing
flag to stop the listen

ipmanager

private IPManager ipmanager
parent ipmanager

status

private int status
status of the thread

onreceive

private IPCallback onreceive

thread

private java.lang.Thread thread
actual thread running

listenAddress

private IPAddress listenAddress
address (port) on which to listen
Constructor Detail

ListenThread

public ListenThread(IPAddress address,
                    IPManager ipm,
                    IPCallback cb)
Constructor - will listen on the given address
Parameters:
address - Description of Parameter
ipm - Description of Parameter
cb - Description of Parameter
Method Detail

getStatus

public int getStatus()
return status code
Returns:
The Status value

getAddress

public IPAddress getAddress()
return listen address
Returns:
The Address value

stopListen

public void stopListen()
stop listening

run

public void run()
Main processing method for the ListenThread object
Specified by:
run in interface java.lang.Runnable


Copyright © 2001 Eyebolt, Inc.