public class ExtasysUDPClient
extends java.lang.Object
Constructor and Description |
---|
ExtasysUDPClient(java.lang.String name,
java.lang.String description,
int corePoolSize,
int maximumPoolSize)
Constructs a new Extasys UDP Client.
|
Modifier and Type | Method and Description |
---|---|
UDPConnector |
AddConnector(java.lang.String name,
int readBufferSize,
int readTimeOut,
java.net.InetAddress serverIP,
int serverPort)
Add a new connector to this client.
|
void |
Dispose()
Dispose the client.
|
int |
getBytesIn()
Returns the total bytes received.
|
int |
getBytesOut()
Returns the total bytes send.
|
java.util.ArrayList |
getConnectors()
Return ArrayList with the client's connectors.
|
java.lang.String |
getDescription()
Return the description of the client.
|
java.util.concurrent.ThreadPoolExecutor |
getMyThreadPool()
Return the client's Thread Pool.
|
java.lang.String |
getName()
Return the name of the client.
|
void |
OnDataReceive(UDPConnector connector,
java.net.DatagramPacket packet) |
void |
RemoveConnector(java.lang.String name)
Stop and remove a connector.
|
void |
SendData(byte[] bytes,
int offset,
int length)
Send data from all connector's to all hosts.
|
void |
SendData(java.lang.String data)
Send data from all connector's to all hosts.
|
void |
Start()
Start or restart the client.
|
void |
Stop()
Stop the client.
|
public ExtasysUDPClient(java.lang.String name, java.lang.String description, int corePoolSize, int maximumPoolSize)
name
- is the name of the client.description
- is the description of the client.corePoolSize
- is the number of threads to keep in the pool, even if they are idle.maximumPoolSize
- is the maximum number of threads to allow in the pool.public UDPConnector AddConnector(java.lang.String name, int readBufferSize, int readTimeOut, java.net.InetAddress serverIP, int serverPort)
name
- is the name of the connector.readBufferSize
- is the maximum number of bytes the connector can read at a time.readTimeOut
- is the maximum time in milliseconds the connector can use to read incoming data.serverIP
- is the server's ip address the connector will use to send data.serverPort
- is the server's udp port.public void RemoveConnector(java.lang.String name)
name
- is the name of the connector.public void SendData(java.lang.String data) throws java.io.IOException
data
- is the string to be send.java.io.IOException
public void SendData(byte[] bytes, int offset, int length) throws java.io.IOException
bytes
- is the byte array to be send.offset
- is the position in the data buffer at witch to begin sending.length
- is the number of the bytes to be send.java.io.IOException
public void Start() throws java.net.SocketException, java.lang.Exception
java.net.SocketException
java.lang.Exception
public void Stop()
public void Dispose()
public void OnDataReceive(UDPConnector connector, java.net.DatagramPacket packet)
public java.lang.String getName()
public java.lang.String getDescription()
public java.util.ArrayList getConnectors()
public java.util.concurrent.ThreadPoolExecutor getMyThreadPool()
public int getBytesIn()
public int getBytesOut()