rcx
Class RCXServer

java.lang.Object
  extended by rcx.RCXServer
All Implemented Interfaces:
java.lang.Runnable, java.util.EventListener, RCXErrorListener

public class RCXServer
extends java.lang.Object
implements RCXErrorListener, java.lang.Runnable

RCXServer - used to receive remote tcp connections to control a local RCX
Usage: RCXServer rcxportname [port number]

Version:
2.1 Copyright 2002 Dario Laverde, under terms of GNU LGPL
Author:
Dario Laverde

Constructor Summary
RCXServer(java.lang.String rcxport, int portnum)
          RCXServer is a proxy server for handling remote TCP socket clients to control a local RCX.
 
Method Summary
static void main(java.lang.String[] args)
          The command line driven main for RCXServer.
 void receivedError(java.lang.String error)
          This implements the RCXErrorListener interface to listen and handle errors.
 void run()
          RCXServer runs as a thread looping around a server socket's accept() and handling one client at a time until it disconnects.
 void stop()
          This is called to stop the server's thread and gracefully close the sockets.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RCXServer

public RCXServer(java.lang.String rcxport,
                 int portnum)
RCXServer is a proxy server for handling remote TCP socket clients to control a local RCX.

Method Detail

main

public static void main(java.lang.String[] args)
The command line driven main for RCXServer. Usage: RCXServer rcxportname [port number] The default port is 174, the port name is mandatory.


run

public void run()
RCXServer runs as a thread looping around a server socket's accept() and handling one client at a time until it disconnects. The client's socket streams are handed to RCXPort and mapped to the local rcx port.

Specified by:
run in interface java.lang.Runnable
See Also:
RCXPort

stop

public void stop()
This is called to stop the server's thread and gracefully close the sockets.


receivedError

public void receivedError(java.lang.String error)
This implements the RCXErrorListener interface to listen and handle errors. It will display the error to stderr and close the current client connection.

Specified by:
receivedError in interface RCXErrorListener
See Also:
RCXErrorListener