Code example for InetSocketAddress

Methods: getAddress, getPort

0
			host = uri.substring(0, c);
			if (host.indexOf('/') > 0)
				host = host.substring(host.indexOf('/') + 1);
		} 
 
		InetSocketAddress inetAddress = new InetSocketAddress(host,
				Integer.parseInt(port));
 
		// if 
		// (isForbidden(HttpMessage.__SSL_SCHEME,addrPort.getHost(),addrPort.getPort(),false)) 
		// { 
		// sendForbid(request,response,uri); 
		// } 
		// else 
		{ 
			InputStream in = request.getInputStream();
			final OutputStream out = response.getOutputStream();
 
			final Socket socket = new Socket(inetAddress.getAddress(),
					inetAddress.getPort());
 
			response.setStatus(200);
			response.setHeader("Connection", "close");
			response.flushBuffer();