com.acap.rudp.me
Class J2meClient

java.lang.Object
  extended by com.acap.rudp.core.StatefulRunnable
      extended by com.acap.rudp.core.BaseUDPSessionManager
          extended by com.acap.rudp.me.J2meClient
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
SampleJ2MEClient

public abstract class J2meClient
extends BaseUDPSessionManager

Implementation of a J2ME Reliable UDP Client Variable length messages are resent automatically until received by the receipient Use: 1. Create an instance 2. call start() 3. when shutting down call stop()


Constructor Summary
J2meClient(java.lang.String senderId, java.lang.String serverUrl)
          Creates an instance
 
Method Summary
 boolean getConnectionStatus()
          Returns current connection status
 boolean isConnectionTimedOut()
          Returns timed out status of connection
abstract  void receiveException(java.lang.Exception x)
           
 void start()
          Starts the client.
 void stop()
          Stops the client
 
Methods inherited from class com.acap.rudp.core.BaseUDPSessionManager
doRun, getLastMessageReceivedDateTimeMillis, getPendingAcknowledgmentCount, getReceivedCount, getSenderId, getSentCount, hasMessagesPendingAck, incrementReceivedCount, receivePacket, send, updateLastMessageReceivedDateTime
 
Methods inherited from class com.acap.rudp.core.StatefulRunnable
isStarted, run
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

J2meClient

public J2meClient(java.lang.String senderId,
                  java.lang.String serverUrl)
           throws java.lang.Exception
Creates an instance

Parameters:
senderId - 17 character length ID of this device
serverUrl - Datagram URL
Throws:
java.lang.Exception
Method Detail

receiveException

public abstract void receiveException(java.lang.Exception x)

getConnectionStatus

public boolean getConnectionStatus()
Returns current connection status

Returns:
true if connected, false otherwise

isConnectionTimedOut

public boolean isConnectionTimedOut()
Returns timed out status of connection

Returns:
true if connection has timed out, false otherwise

stop

public void stop()
Stops the client

Overrides:
stop in class StatefulRunnable

start

public void start()
           throws java.lang.Exception
Starts the client.

Overrides:
start in class StatefulRunnable
Throws:
java.lang.Exception - if already started.