知识库--Parsing the Connection

来源:互联网 发布:matlab em算法 编辑:程序博客网 时间:2024/06/06 17:27

The parseConnection method obtains the Internet address from the socket and assigns it to the HttpRequestImpl object. It also checks if a proxy is used and assigns the socket to the request object. The parseConnection method is given following.

    private void parseConnection(Socket socket) throws IOException,    ServletException{        if(debug > 2){            log(" parseConnection: address=" + socket.getInetAddress() +             ",port = " + connector.getPort());        }        ((HttpRequestInput)request).setInet(socket.getInetAddress());        if(proxyPort != 0){            request.setServerPort(proxyPort);        }else{            request.setServerPort(serverPort);        }        request.setSocket(socket);      }
0 0