|
|||||||||
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 FormField Summary | |
static int |
ADDR
Error code ADDR, one or both of the IP addresses could not be negotiated. |
static int |
AUTH
Error code AUTH, remote peer rejected this peers authentication credentials. |
static int |
AUTHENTICATION_REQUEST
Event AUTHENTICATION, PPP has received an authentication request from the remote peer. |
static int |
CLOSED
Event CLOSED, PPP has entered the closed state. |
static int |
NONE
Error code NONE, no error. |
static int |
REJECT
Error code REJECT, link options have been rejected by remote peer. |
static int |
STARTING
Event STARTING, PPP has enetered the starting state. |
static int |
STOPPED
Event STOPPED, PPP has entered the stopped state. |
static int |
TIME
Error code TIME, link negotiation timed out. |
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 AUTHENTICATION_REQUEST
An AUTHENTICATION_REQESTED
event is generated if PPP.setAuthenticate
is invoked
with a parameters value of true. This will cause PPP to request authentication information from the
remote peer during its negotiation of the connection. This event gives the application the chance to
verify the login information. The PPP.getRemoteUserName
and PPP.getRemotePassword
methods are used to retreive the remote peer's login information. After the application examines the
login information it invokes the PPP.authenticate
method with a value of true if the remote
peer's login information is acceptable. In this case PPP continues its negotiation of the connection.
If the login information is invalid calling PPP.authenticate
with a value of false will
cause PPP to reject the clients connection request and generate a STOPPED
event.
public static final int STOPPED
The STOPPED
event is typically generated in response to an error condition. Some of the
possible sources of errors include problems negotiating connection options, rejections of authentication
information, rejection of PAP authentication protocol or the remote peer explicitly closing the connection.
The source of the error can determined by invoking the PPP.getLastError
method on the PPPEvent
object passed to the event listener.
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
public static final int ADDR
public static final int AUTH
public static final int TIME
PPP.setrestartPeriod
.public static final int REJECT
PPP.setMaxFailure
.Method Detail |
public int getEventType()
public int getLastError()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |