|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.EventObject
|
+--com.dalsemi.tininet.ppp.PPPEvent
When a PPP object is created it starts a deamon thread to listen for events originating from the native PPP module. This thread generates the events that notify PPP event listeners of important changes in the state of a PPP connection. The events generated by the deamon thread are defined as integer constants and shown below:
Each event object also includes an error code. The error codes generated are defined as integer constants and shown below:
PPP,
PPPEventListener, Serialized Form| Field Summary | |
static int |
CLOSED
Event CLOSED, PPP has entered the closed state. |
static int |
NONE
Error code NONE, no error. |
static int |
STARTING
Event STARTING, PPP has enetered the starting state. |
static int |
UP
Event UP, PPP has entered the up state. |
| Fields inherited from class java.util.EventObject |
source |
| Method Summary | |
int |
getEventType()
Gets the event type for this PPPEvent |
int |
getLastError()
Gets the error type for this PPPEvent |
| Methods inherited from class java.util.EventObject |
getSource,
toString |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int UP
An UP event is generated if the connection is successfully established. At this point the PPP
connection is established and is read for IP network traffic. However the application must invoke the
PPP.addInterface method before the TCP/IP stack will recognize the new PPP connection as a valid
network interface. The interface name passed to PPP.addInterface is typically formed by appending the
number of the serial port being used for PPP traffic to the lower case string 'ppp'.
public static final int CLOSED
The CLOSED event occurs when the PPP link is no longer available. The link can become
unavailable because the link was shut down normally or as the result of an error. After receiving the
CLOSED event the PPP listener frees any resources that were consumed establishing the
connection. The listener should also call the PPP.removeInterface method to remove the
PPP network interface.
public static final int STARTING
A STARTING event is generated by the application invoking the PPP.open method.
The STARTING event provides the application with a chance to bring up the physical communications
link. At a minimum this involves initializing the serial port that will be used by all PPP traffic. If a modem
is attached to the serial port the application also intializes the modem and either instructs it to dial a
remote modem or waits for the modem to answer an incomming call. After the physical communication link has been
established the application invokes PPP.up method. At this point PPP assumes
exclusive use of the serial port. Any other attempt to read from or write to the serial port could disrupt
the PPP connection and will likely result in a STOPPPED event being generated.
public static final int NONE
| Method Detail |
public int getEventType()
public int getLastError()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||