PenServer Class Reference

Inheritance diagram for PenServer:

PenListener List of all members.

Public Member Functions

 PenServer (ServerSocket ss, ClientServerType type)
boolean isPenUp ()
void penDown (PenSample s)
 Since with a PenListener.
void penUp (PenSample s)
 Jun 12, 2006
void sample (PenSample sample)

Static Public Member Functions

static boolean javaServerStarted ()
static void main (String[] args)
static void startBothServers (COMPort serialPortName, int tcpipPortJava, int tcpipPortPlainText)
 Provides default implementation.
static void startJavaServer ()
 Provides default implementation.
static void startJavaServer (COMPort serialPort)
 Use the default java port.
static void startJavaServer (COMPort serialPort, int tcpipPort)
 Start a Java server on this machine at the corresponding TCP/IP port.
static void startTextServer ()
static void startTextServer (COMPort serialPort, int tcpipPort)
 NOTE, you can only start one PenStreamingConnection at a time, on the local machine.
static void stopServers ()
static boolean textServerStarted ()

Static Public Attributes

static final int DEFAULT_JAVA_PORT = Constants.Ports.PEN_SERVER_JAVA
 The default port to which pen clients can connect.
static final int DEFAULT_PLAINTEXT_PORT = Constants.Ports.PEN_SERVER_PLAINTEXT
static final COMPort DEFAULT_SERIAL_PORT = COMPort.COM5

Classes

class  ServerThread

Detailed Description

This software is distributed under the BSD License.

Author:
Ron B Yeh [ronyeh(AT)cs.stanford.edu]

Joel Brandt

Definition at line 28 of file PenServer.java.


Constructor & Destructor Documentation

PenServer ( ServerSocket  ss,
ClientServerType  type 
)

Parameters:
ss 
type 

Definition at line 258 of file PenServer.java.

Referenced by PenServer.startJavaServer(), and PenServer.startTextServer().


Member Function Documentation

boolean isPenUp (  ) 

Returns:
is the pen currently up?

Definition at line 270 of file PenServer.java.

static boolean javaServerStarted (  )  [static]

Returns:
whether there is a local Java server running.

Definition at line 103 of file PenServer.java.

static void main ( String[]  args  )  [static]

Parameters:
args 

Definition at line 117 of file PenServer.java.

References PenServer.DEFAULT_JAVA_PORT, PenServer.DEFAULT_PLAINTEXT_PORT, PenServer.DEFAULT_SERIAL_PORT, and PenServer.startBothServers().

void penDown ( PenSample  s  ) 

Since with a PenListener.

.. a penDown event NEVER overlaps with a penSample event, we now must send a sample over the wire for penDown events too!

Jun 12, 2006

Author:
Ron Yeh

Implements PenListener.

Definition at line 281 of file PenServer.java.

References PenServer.sample().

void penUp ( PenSample  s  ) 

Jun 12, 2006

Author:
Ron Yeh

Implements PenListener.

Definition at line 290 of file PenServer.java.

References PenServer.sample().

void sample ( PenSample  sample  ) 

See also:
edu.stanford.hci.r3.pen.streaming.listeners.PenListener.sample(edu.stanford.hci.r3.pen.PenSample)

Implements PenListener.

Definition at line 299 of file PenServer.java.

Referenced by PenServer.penDown(), and PenServer.penUp().

static void startBothServers ( COMPort  serialPortName,
int  tcpipPortJava,
int  tcpipPortPlainText 
) [static]

Provides default implementation.

It's unclear we want two servers going at the same time. Won't performance be better if we only send one stream of data? Also, what about Multicast? Then, multiple clients can listen in very easily. However, we'd need a server that will dole out the multicast address... This is simpler for now.

Definition at line 151 of file PenServer.java.

References PenServer.startJavaServer(), and PenServer.startTextServer().

Referenced by PenServer.main().

static void startJavaServer ( COMPort  serialPort,
int  tcpipPort 
) [static]

Start a Java server on this machine at the corresponding TCP/IP port.

Add the java server as a listener to the local pen connection (at the specified COM port).

Parameters:
tcpipPort 

Definition at line 178 of file PenServer.java.

References PenStreamingConnection.addPenListener(), PenStreamingConnection.getInstance(), and PenServer.PenServer().

static void startJavaServer ( COMPort  serialPort  )  [static]

Use the default java port.

..

Parameters:
serialPort 

Definition at line 168 of file PenServer.java.

References PenServer.DEFAULT_JAVA_PORT, and PenServer.startJavaServer().

static void startJavaServer (  )  [static]

Provides default implementation.

Only start the Java Server.

Definition at line 159 of file PenServer.java.

References PenServer.DEFAULT_JAVA_PORT, and PenServer.DEFAULT_SERIAL_PORT.

Referenced by PenServer.startBothServers(), and PenServer.startJavaServer().

static void startTextServer ( COMPort  serialPort,
int  tcpipPort 
) [static]

NOTE, you can only start one PenStreamingConnection at a time, on the local machine.

Thus, if you have created on one COM5, you cannot create another one at COM6, until you kill the connection.

Parameters:
tcpipPort 

Definition at line 208 of file PenServer.java.

References PenStreamingConnection.addPenListener(), PenStreamingConnection.getInstance(), and PenServer.PenServer().

static boolean textServerStarted (  )  [static]

Returns:

Definition at line 237 of file PenServer.java.


Member Data Documentation

final int DEFAULT_JAVA_PORT = Constants.Ports.PEN_SERVER_JAVA [static]

The default port to which pen clients can connect.

..

Definition at line 85 of file PenServer.java.

Referenced by PenServer.main(), and PenServer.startJavaServer().


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:44 2007 for R3 Paper Toolkit by  doxygen 1.4.7