|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.net.ntp.NtpConnection
public class NtpConnection
This class encapsulates the exchange of a NtpDatagram between a client and a server.
| Field Summary | |
|---|---|
static int |
defaultNtpPort
Default port for the NTP protocol. |
| Constructor Summary | |
|---|---|
NtpConnection(java.net.InetAddress iaddr)
Creates a UDP connection for the exchange of NtpDatagrams. |
|
NtpConnection(java.net.InetAddress iaddr,
int iport)
Creates a UDP connection for the exchange of NtpDatagrams. |
|
| Method Summary | |
|---|---|
void |
close()
Close the connection. |
void |
finalize()
Could be used to do some cleaning up. |
NtpInfo |
getInfo()
Obtain info from the server. |
java.util.Date |
getTime()
Get the time from the server. |
int |
getTimeout()
Get the timeout associated with the connection. |
java.util.Vector |
getTrace()
Traces a server to the primary server. |
void |
receive(NtpDatagramPacket ntpDatagramPacket)
Wait for a reply from the server. |
void |
send(NtpDatagramPacket ntpDatagramPacket)
Send a NtpDatagram to the server. |
void |
setTimeout(int timeout)
Set the timeout associated with the connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int defaultNtpPort
| Constructor Detail |
|---|
public NtpConnection(java.net.InetAddress iaddr,
int iport)
throws java.net.SocketException
iaddr - DOCUMENT ME!iport - DOCUMENT ME!
java.net.SocketException - DOCUMENT ME!
public NtpConnection(java.net.InetAddress iaddr)
throws java.net.SocketException
iaddr - DOCUMENT ME!
java.net.SocketException - DOCUMENT ME!| Method Detail |
|---|
public int getTimeout()
public void setTimeout(int timeout)
throws java.net.SocketException
timeout - DOCUMENT ME!
java.net.SocketException - DOCUMENT ME!
public void send(NtpDatagramPacket ntpDatagramPacket)
throws java.io.IOException
ntpDatagramPacket - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
public void receive(NtpDatagramPacket ntpDatagramPacket)
throws java.io.IOException
ntpDatagramPacket - DOCUMENT ME!
java.io.IOException - A IOException is thrown in case of a timeout.
public NtpInfo getInfo()
throws java.io.IOException
java.io.IOException - A IOException is thrown in case of a timeout.NtpInfopublic java.util.Vector getTrace()
public java.util.Date getTime()
public void close()
public void finalize()
finalize in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||