gov.nasa.gsfc.drl.rtstps.server
Class UdpServer

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by gov.nasa.gsfc.drl.rtstps.server.AbstractServer
                  extended by gov.nasa.gsfc.drl.rtstps.server.UdpServer
All Implemented Interfaces:
RtStpsServices, java.io.Serializable, java.lang.Runnable, java.rmi.Remote

public class UdpServer
extends AbstractServer

This is an RT-STPS server that receives telemetry through UDP datagrams.

You may pass one argument when invoking, the server name. The full server name then becomes "RtStpsServices."+name. The default full server name is "RtStpsServices.U".

The server understands the following system properties. You set them when you run the server using the -D attribute as in "-Dport=5000".


The site.properties file is processed if it is present for configuring the log and it will take precedence over some of these option, even if they are present.


-Dport=4395
The UDP port number that the server reads for telemetry data. The default port is 4395.
-DbufferSizeKb=????
The input packet buffer size in kilobytes. The default is the platform's default UDP input buffer size. Some platforms may not receive messages if you set the buffer size to something greater than the platform default.
-DblockSizeKb=8
This is the number of kilobytes the pipeline process in one chunk. It should evenly divide into bufferSizeKb. I recommend that you set it to 1/2, 1/4, 1/8 etc of bufferSizeKb to create double+ buffering. The default is 4.
-DsourceIpAddress=null
If you supply a source IP address, then the server rejects any packet from any other source. If you omit it, it accepts all packets.
-Dlog.stdout
If specified, log messages are written to the standard output.
note: this is overridden by the presence of a site.properties file
-Dlog.file=file
If specified, log messages are written to file.
note: this is overridden by the presence of a site.properties file
-Dlog.server=host:port:tmpDir
If specified, log messages are sent to the NSLS server at host:port (eg. localhost:3500) and to the temporary directory tmpDir when the NSLS server is unavailable.
note: this is overridden by the presence of a site.properties file

This class supports only one pipeline thread.

See Also:
Serialized Form

Field Summary
private  int blockSize
           
private  java.net.DatagramPacket packet
           
private static long serialVersionUID
           
private  java.net.DatagramSocket socket
           
private  java.lang.String sourceIpAddress
           
 
Fields inherited from class gov.nasa.gsfc.drl.rtstps.server.AbstractServer
fs, runner, running, state, statusBlocks
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
UdpServer(java.lang.String sourceIp, int dataPort, int buffersize, int blocksize)
          Create a server.
 
Method Summary
static void main(java.lang.String[] args)
          This is the main entry point for the RT-STPS server.
 void run()
          This thread method gets data from the UDP socket and sends it down the pipeline if it exists.
 
Methods inherited from class gov.nasa.gsfc.drl.rtstps.server.AbstractServer
getConfigurationName, getStatus, getStatusToString, isEnabled, load, load, loadFile, log, setEnabled, stopServer, unload, zeroStatus
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

blockSize

private int blockSize

sourceIpAddress

private java.lang.String sourceIpAddress

socket

private java.net.DatagramSocket socket

packet

private java.net.DatagramPacket packet

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

UdpServer

public UdpServer(java.lang.String sourceIp,
                 int dataPort,
                 int buffersize,
                 int blocksize)
          throws java.rmi.RemoteException
Create a server.

Throws:
java.rmi.RemoteException
Method Detail

main

public static void main(java.lang.String[] args)
This is the main entry point for the RT-STPS server.


run

public void run()
This thread method gets data from the UDP socket and sends it down the pipeline if it exists. It discards the data if the pipeline is null.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class AbstractServer