Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scoja.server.source
Class UDPSource  view UDPSource download UDPSource.java

java.lang.Object
  extended byorg.scoja.server.core.ClusterSkeleton
      extended byorg.scoja.server.source.UDPSource
All Implemented Interfaces:
org.scoja.server.core.Cluster, org.scoja.server.core.DecoratedLink, java.lang.Runnable

public class UDPSource
extends org.scoja.server.core.ClusterSkeleton
implements org.scoja.server.core.DecoratedLink, java.lang.Runnable


Field Summary
static int DEFAULT_MAX_PACKET_SIZE
           
protected  java.lang.String ip
           
protected  org.scoja.server.core.Link link
           
protected  int maxPacketSize
           
protected  int port
           
protected  java.net.DatagramSocket socket
           
 
Fields inherited from class org.scoja.server.core.ClusterSkeleton
currentThreadCount, DEFAULT_THREAD_COUNT, isRunning, maxThreadCount, stopRequested, threads
 
Constructor Summary
UDPSource()
           
 
Method Summary
 org.scoja.server.core.Linkable getLinkable()
           
 void run()
          This method will be called by whoever wishes to run your class implementing Runnable.
 void setIp(java.lang.String ip)
           
 void setMaxPacketSize(int max)
           
 void setPort(int port)
           
 void shouldStop()
           
 void start()
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class org.scoja.server.core.ClusterSkeleton
getCurrentThreads, getThreads, isRunning, setThreads, startAllThreads, startAnotherThread, stopRequested, threadStopped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MAX_PACKET_SIZE

public static final int DEFAULT_MAX_PACKET_SIZE
See Also:
Constant Field Values

link

protected final org.scoja.server.core.Link link

ip

protected java.lang.String ip

port

protected int port

maxPacketSize

protected int maxPacketSize

socket

protected java.net.DatagramSocket socket
Constructor Detail

UDPSource

public UDPSource()
Method Detail

getLinkable

public org.scoja.server.core.Linkable getLinkable()
Specified by:
getLinkable in interface org.scoja.server.core.DecoratedLink

setIp

public void setIp(java.lang.String ip)

setPort

public void setPort(int port)

setMaxPacketSize

public void setMaxPacketSize(int max)

start

public void start()
Specified by:
start in interface org.scoja.server.core.Cluster

shouldStop

public void shouldStop()
Specified by:
shouldStop in interface org.scoja.server.core.Cluster

run

public void run()
Description copied from interface: java.lang.Runnable
This method will be called by whoever wishes to run your class implementing Runnable. Note that there are no restrictions on what you are allowed to do in the run method, except that you cannot throw a checked exception.

Specified by:
run in interface java.lang.Runnable

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).