Example usage for org.apache.commons.net.ntp NtpV3Packet NTP_PORT

List of usage examples for org.apache.commons.net.ntp NtpV3Packet NTP_PORT

Introduction

In this page you can find the example usage for org.apache.commons.net.ntp NtpV3Packet NTP_PORT.

Prototype

int NTP_PORT

To view the source code for org.apache.commons.net.ntp NtpV3Packet NTP_PORT.

Click Source Link

Document

Standard NTP UDP port

Usage

From source file:examples.ntp.SimpleNTPServer.java

public static void main(String[] args) {
    int port = NtpV3Packet.NTP_PORT;
    if (args.length != 0) {
        try {// w  ww. j  av  a  2  s . c o  m
            port = Integer.parseInt(args[0]);
        } catch (NumberFormatException nfe) {
            nfe.printStackTrace();
        }
    }
    SimpleNTPServer timeServer = new SimpleNTPServer(port);
    try {
        timeServer.start();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:examples.ntp.SimpleNTPServer.java

/**
 * Create SimpleNTPServer listening on default NTP port.
 */
public SimpleNTPServer() {
    this(NtpV3Packet.NTP_PORT);
}