com.dalsemi.tininet.ppp
Class PPPEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.dalsemi.tininet.ppp.PPPEvent

public class PPPEvent
extends java.util.EventObject

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:

See Also:
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

UP

public static final int UP
Event UP, PPP has entered the up state.

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'.


CLOSED

public static final int CLOSED
Event CLOSED, PPP has entered the closed state.

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.


STARTING

public static final int STARTING
Event STARTING, PPP has enetered the starting state.

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.


NONE

public static final int NONE
Error code NONE, no error.
Method Detail

getEventType

public int getEventType()
Gets the event type for this PPPEvent
Returns:
event type

getLastError

public int getLastError()
Gets the error type for this PPPEvent
Returns:
error type


Also see:
o TINI 1.16 API
o TINI Home Page
o 1-Wire API

o JDK 1.1

Last update Wed Jun 8 17:19:36 CDT 2005