Methods Summary |
---|
public void | disconnect()Disconnects the client socket
synchronized (clientSocket)
{
try
{
clientSocket.notify();
}
catch (Exception e)
{
System.err.println("Exception in notify, "+ e.getMessage());
}
}
|
public java.io.InputStream | getInputStream()Gets the input stream for the client socket
if(clientSocket != null)
{
return(clientSocket.getInputStream());
}
else
{
return(null);
}
|
public java.io.OutputStream | getOutputStream()Gets the output stream for the client socket
if(clientSocket != null)
{
return(clientSocket.getOutputStream());
}
else
{
return(null);
}
|
public void | run()Run for the thread. Waits for new connections
boolean bError = false;
while(!bError)
{
try
{
clientSocket = serverSocket.accept();
synchronized (clientSocket)
{
try
{
clientSocket.wait();
}
catch (Exception e)
{
System.err.println("Exception in wait, "+ e.getMessage());
}
try
{
clientSocket.close();
}
catch (Exception e)
{
System.err.println("Exception in close, "+ e.getMessage());
}
}
}
catch (IOException e)
{
bError = true;
}
}
try
{
serverSocket.close();
}
catch (Exception e)
{
System.err.println("Exception in close, "+ e.getMessage());
}
|
public void | stop()Stop the listener thread
listener.interrupt();
try
{
serverSocket.close();
}
catch (Exception e)
{
System.err.println("Exception in close, "+ e.getMessage());
}
|