- java.lang.Object
-  
      - com.sun.net.httpserver.HttpServer
-  
        - com.sun.net.httpserver.HttpsServer
 
 
-  
       
 public abstract class HttpsServer extends HttpServer 此类是HttpServer的扩展,它提供对HTTPS的支持。HttpsServer必须具有关联的 HttpsConfigurator对象,该对象用于为SSL连接建立SSL配置。所有其他配置与HttpServer相同。 - 从以下版本开始:
- 1.6
 
-  
        
       -  
             构造方法摘要构造方法 变量 构造器 描述 protectedHttpsServer()
 -  
             方法摘要所有方法 静态方法 实例方法 抽象方法 具体的方法 变量和类型 方法 描述 static HttpsServercreate()创建一个HttpsServer实例,该实例最初未绑定到任何本地地址/端口。static HttpsServercreate(InetSocketAddress addr, int backlog)创建一个HttpsServer实例,该实例将绑定到指定的InetSocketAddress(IP地址和端口号)也可以指定最大积压。abstract HttpsConfiguratorgetHttpsConfigurator()获取此服务器的HttpsConfigurator对象(如果已设置)。abstract voidsetHttpsConfigurator(HttpsConfigurator config)设置此服务器的HttpsConfigurator对象。-  
               声明方法的类 com.sun.net.httpserver.HttpServerbind, createContext, createContext, getAddress, getExecutor, removeContext, removeContext, setExecutor, start, stop
 
-  
               
 
-  
             
-  
        
       -  
             方法详细信息-  createpublic static HttpsServer create() throws IOException 创建一个HttpsServer实例,该实例最初未绑定到任何本地地址/端口。 HttpsServer是从当前安装的HttpServerProvider获取的 。服务器必须先使用HttpServer.bind(InetSocketAddress,int)进行绑定才能使用。 服务器还必须具有使用setHttpsConfigurator(HttpsConfigurator)建立的HttpsConfigurator- 异常
-  
              IOException
 
 -  createpublic static HttpsServer create(InetSocketAddress addr, int backlog) throws IOException 创建一个HttpsServer实例,该实例将绑定到指定的InetSocketAddress(IP地址和端口号)也可以指定最大积压。 这是侦听套接字上允许的最大排队传入连接数。 TCP实现可能会拒绝超过此限制的排队TCP连接。 从当前安装的HttpServerProvider获取HttpsServer服务器必须具有与setHttpsConfigurator(HttpsConfigurator)建立的HttpsConfigurator- 参数
-  
              addr- 要监听的地址,如果null则必须调用bind()来设置地址
-  
              backlog- 套接字积压。 如果此值小于或等于零,则使用系统默认值。
- 异常
-  
              BindException- 如果服务器无法绑定到请求的地址,或者服务器已绑定。
-  
              IOException
 
 -  setHttpsConfiguratorpublic abstract void setHttpsConfigurator(HttpsConfigurator config) 设置此服务器的HttpsConfigurator对象。- 参数
-  
              config- 要设置的HttpsConfigurator
- 异常
-  
              NullPointerException- 如果config为null。
 
 -  getHttpsConfiguratorpublic abstract HttpsConfigurator getHttpsConfigurator() 获取此服务器的HttpsConfigurator对象(如果已设置)。- 结果
- 
               此服务器的 
              null如果未设置,null。
 
 
-  
 
-