APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.httpserver.simpleserver

public Class Main

extends Object
Class Inheritance
Imports
java.io.PrintWriter

Programmatic entry point to start "java -m jdk.httpserver".

Field Summary

Modifier and TypeField and Description
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
private
Main()

This constructor should never be called.

Method Summary

Modifier and TypeMethod and Description
public static void
main(String...
the command-line options
args
)

The main entry point.

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAXREQTIME_KEYback to summary
public static final String MAXREQTIME_KEY
MAXREQTIME_VALback to summary
public static final String MAXREQTIME_VAL

Constructor Detail

Mainback to summary
private Main()

This constructor should never be called.

Method Detail

mainback to summary
public static void main(String... args)

The main entry point.

The command line arguments are parsed and the server is started. If started successfully, the server will run on a new non-daemon thread, and this method will return. Otherwise, if the server is not started successfully, e.g. an error is encountered while parsing the arguments or an I/O error occurs, the server is not started and this method invokes System::exit with an appropriate exit code.

If the system property "sun.net.httpserver.maxReqTime" has not been set by the user, it is set to a value of 5 seconds. This is to prevent the server from hanging indefinitely, for example in the case of an HTTPS request.

Parameters
args:String[]

the command-line options

Exceptions
NullPointerException:
if args is null, or if there are any null values in the args array
setMaxReqTimeback to summary
private static void setMaxReqTime()