亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? simpleproxyserver.java

?? Examples From Java Examples in a Nutshell, 2nd Edition 書(shū)中的源碼
?? JAVA
字號(hào):
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.net;import java.io.*;import java.net.*;/** * This class implements a simple single-threaded proxy server. **/public class SimpleProxyServer {    /** The main method parses arguments and passes them to runServer */    public static void main(String[] args) throws IOException {        try {            // Check the number of arguments            if (args.length != 3)                 throw new IllegalArgumentException("Wrong number of args.");	                // Get the command-line arguments: the host and port we are proxy            // for and the local port that we listen for connections on.            String host = args[0];            int remoteport = Integer.parseInt(args[1]);            int localport = Integer.parseInt(args[2]);            // Print a start-up message            System.out.println("Starting proxy for " + host + ":" + 			       remoteport + " on port " + localport);            // And start running the server            runServer(host, remoteport, localport);   // never returns        }         catch (Exception e) {            System.err.println(e);            System.err.println("Usage: java SimpleProxyServer " +			       "<host> <remoteport> <localport>");        }    }        /**     * This method runs a single-threaded proxy server for      * host:remoteport on the specified local port.  It never returns.     **/    public static void runServer(String host, int remoteport, int localport) 	throws IOException {        // Create a ServerSocket to listen for connections with        ServerSocket ss = new ServerSocket(localport);	        // Create buffers for client-to-server and server-to-client transfer.        // We make one final so it can be used in an anonymous class below.        // Note the assumptions about the volume of traffic in each direction.        final byte[] request = new byte[1024];        byte[] reply = new byte[4096];                // This is a server that never returns, so enter an infinite loop.        while(true) {            // Variables to hold the sockets to the client and to the server.            Socket client = null, server = null;            try {                // Wait for a connection on the local port                client = ss.accept();                                // Get client streams.  Make them final so they can                // be used in the anonymous thread below.                final InputStream from_client = client.getInputStream();                final OutputStream to_client = client.getOutputStream();                // Make a connection to the real server.                // If we cannot connect to the server, send an error to the                 // client, disconnect, and continue waiting for connections.                try { server = new Socket(host, remoteport); }                 catch (IOException e) {                    PrintWriter out = new PrintWriter(to_client);                    out.print("Proxy server cannot connect to " + host + ":"+			      remoteport + ":\n" + e + "\n");                    out.flush();                    client.close();                    continue;                }                                // Get server streams.                final InputStream from_server = server.getInputStream();                final OutputStream to_server = server.getOutputStream();                // Make a thread to read the client's requests and pass them                // to the server.  We have to use a separate thread because                // requests and responses may be asynchronous.                Thread t = new Thread() {                    public void run() {                        int bytes_read;                        try {                            while((bytes_read=from_client.read(request))!=-1) {                                to_server.write(request, 0, bytes_read);                                to_server.flush();                            }                        }                        catch (IOException e) {}                        // the client closed the connection to us, so close our                        // connection to the server.  This will also cause the                         // server-to-client loop in the main thread exit.                        try {to_server.close();} catch (IOException e) {}                    }                };                // Start the client-to-server request thread running                t.start();                  // Meanwhile, in the main thread, read the server's responses                // and pass them back to the client.  This will be done in                // parallel with the client-to-server request thread above.                int bytes_read;                try {                    while((bytes_read = from_server.read(reply)) != -1) {                        to_client.write(reply, 0, bytes_read);                        to_client.flush();                    }                }                catch(IOException e) {}                // The server closed its connection to us, so we close our                 // connection to our client.		// This will make the other thread exit.                to_client.close();            }            catch (IOException e) { System.err.println(e); }            finally {  // Close the sockets no matter what happens.                try {                     if (server != null) server.close();                     if (client != null) client.close();                 }                catch(IOException e) {}            }        }    }}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲码国产岛国毛片在线| 国产亚洲婷婷免费| 亚洲超碰精品一区二区| 欧美日韩国产123区| 蜜臀av一区二区在线免费观看 | 色先锋久久av资源部| 亚洲精品视频在线| 欧美日韩一级二级| 麻豆国产91在线播放| 日本一区二区不卡视频| 色猫猫国产区一区二在线视频| 亚洲欧美另类久久久精品2019| 欧美中文字幕一二三区视频| 蜜臀精品一区二区三区在线观看 | 成人中文字幕合集| 亚洲女爱视频在线| 欧美一区二区女人| 成人一级黄色片| 亚洲永久免费av| 欧美精品一区二区三| 99精品视频中文字幕| 免费观看在线综合| 亚洲天天做日日做天天谢日日欢| 欧美肥妇bbw| 成人av电影在线网| 日本va欧美va欧美va精品| 欧美激情综合五月色丁香| 欧美亚洲国产一区在线观看网站 | 亚洲成精国产精品女| 久久综合色鬼综合色| 91福利在线看| 国内精品不卡在线| 亚洲电影欧美电影有声小说| 久久综合色8888| 欧美美女视频在线观看| 成av人片一区二区| 久久99日本精品| 亚洲国产精品天堂| 国产精品久久二区二区| 精品国产sm最大网站免费看| 在线观看视频91| 不卡的av在线播放| 国产中文字幕精品| 秋霞午夜av一区二区三区| 136国产福利精品导航| 精品入口麻豆88视频| 欧美午夜精品久久久久久孕妇 | 中文字幕综合网| 久久先锋影音av| 欧美乱熟臀69xxxxxx| 色www精品视频在线观看| 国产91精品在线观看| 久久aⅴ国产欧美74aaa| 日韩国产欧美一区二区三区| 亚洲品质自拍视频| 国产精品麻豆网站| 久久久亚洲高清| 亚洲精品在线免费播放| 欧美精品第1页| 欧美日韩久久不卡| 色婷婷激情久久| 色婷婷综合激情| 99久久久精品免费观看国产蜜| 国产精品一区二区三区网站| 精品中文字幕一区二区| 看电视剧不卡顿的网站| 日韩电影在线观看电影| 天天综合网 天天综合色| 亚洲一区在线观看网站| 亚洲国产aⅴ成人精品无吗| 洋洋av久久久久久久一区| 亚洲免费观看在线观看| 一区二区在线看| 亚洲毛片av在线| 亚洲黄一区二区三区| 亚洲精品国产成人久久av盗摄| 中文字幕在线播放不卡一区| 国产精品麻豆99久久久久久| 欧美高清在线一区二区| 国产午夜精品一区二区| 日本一区二区三区久久久久久久久不| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 亚洲婷婷在线视频| 亚洲麻豆国产自偷在线| 亚洲午夜激情网页| 午夜av区久久| 久久国产生活片100| 国产一区久久久| 北条麻妃国产九九精品视频| av一区二区不卡| 在线看国产一区| 91精品国产91久久久久久一区二区 | 国产精品麻豆久久久| 亚洲乱码国产乱码精品精小说 | 国模娜娜一区二区三区| 国产精品99久久久久久有的能看| 国产成人av福利| 色婷婷国产精品久久包臀| 91麻豆精品国产综合久久久久久| 精品国产污污免费网站入口 | 欧美丰满少妇xxxxx高潮对白 | 香蕉加勒比综合久久| 久久av资源网| 99久久免费精品高清特色大片| 欧洲精品一区二区| 91精品久久久久久蜜臀| 国产人成一区二区三区影院| 亚洲欧美成人一区二区三区| 蜜臀精品久久久久久蜜臀| 高清国产午夜精品久久久久久| 色综合久久综合网97色综合| 日韩精品在线网站| 亚洲日本韩国一区| 久久精品国产精品青草| 99视频超级精品| 欧美一区二区三级| √…a在线天堂一区| 日韩电影在线免费看| 成人久久视频在线观看| 91精品国产综合久久久蜜臀粉嫩| 久久久国产精品麻豆| 亚洲不卡av一区二区三区| 国产精品1区2区3区在线观看| 在线观看日韩一区| 国产欧美日韩一区二区三区在线观看| 亚洲bt欧美bt精品| 成人app在线| 精品国产免费人成电影在线观看四季 | 本田岬高潮一区二区三区| 91精品国产一区二区三区| 国产精品乱人伦| 久久99久久久久久久久久久| 一本到三区不卡视频| 欧美经典一区二区三区| 美女视频一区二区三区| 日本丶国产丶欧美色综合| 国产婷婷色一区二区三区四区| 日韩有码一区二区三区| 日本高清不卡视频| 国产精品青草久久| 国产精品一级黄| 欧美精品1区2区3区| 亚洲精品久久久蜜桃| 成人午夜av电影| 久久婷婷久久一区二区三区| 日本视频一区二区| 欧美日韩在线一区二区| 一区二区三区四区精品在线视频 | 蜜臀a∨国产成人精品| 欧美色涩在线第一页| 亚洲婷婷综合色高清在线| 成人高清在线视频| 久久久久高清精品| 激情国产一区二区 | 成人黄页毛片网站| 久久久国产一区二区三区四区小说 | av中文字幕一区| 久久精品人人做人人综合| 国内精品国产成人| 国产亚洲视频系列| 国产成人精品三级| 中文字幕av一区二区三区| 国产98色在线|日韩| 国产嫩草影院久久久久| 成人黄色免费短视频| 国产精品对白交换视频| 91网站在线观看视频| 国产精品美女久久久久aⅴ| 成人国产精品免费观看动漫| 中文字幕一区二区三中文字幕| 成人影视亚洲图片在线| 亚洲丝袜自拍清纯另类| 91麻豆国产在线观看| 一区二区在线观看视频在线观看| 欧洲日韩一区二区三区| 三级在线观看一区二区| 欧美一区二区成人| 国产精品一二二区| 国产精品久久久久久福利一牛影视| 97久久精品人人澡人人爽| 一区二区三区小说| 日韩亚洲电影在线| 国产美女精品在线| 国产精品国产精品国产专区不蜜| 一本一道综合狠狠老| 性感美女极品91精品| 精品国产一区二区精华| 丁香激情综合五月| 尤物av一区二区| 欧美一区二区三区四区五区| 国产在线乱码一区二区三区| 国产精品私人自拍| 欧美日韩三级视频| 国产麻豆成人传媒免费观看| 亚洲欧洲av在线| 欧美精品第1页| 成人国产一区二区三区精品| 午夜精品一区在线观看| 国产亚洲精品bt天堂精选| 色一情一伦一子一伦一区|