HttpServer内存马 一些基础的方法和类 HttpServer:HttpServer主要是通过带参的create方法来创建,第一个参数InetSocketAddress表示绑定的ip地址和端口号。第二个参数为int类型,表示允许排队的最大TCP连接数,如果该值小于或等于零,则使用系统默认值。 createContext:可以调用多次,表示将指定的url路径绑定到指定的HttpHandler处理器对象上,服务器接收到的所有路径请求都将通过调用给定的处理程序对象来处理。 setExecutor:设置服务器的线程池对象,不设置或者设为null则表示使用start方法创建的线程。 代码例子 首先我们需要知道怎么使用httpserver构建一个HttpServer服务 其实不难,重点只有两部分,一个是server,一个是hander 其实举个例子就能够理解了 import com.sun.net.httpserver.HttpServer; import java.io.IOException; import java.net.InetSocketAddress; import...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile