yuyinclient.java

来自「P2P聊天系统 该程序是由NetBeans IDE 6.5」· Java 代码 · 共 52 行

JAVA
52
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package voice;import java.io.IOException;import java.net.Socket;import java.util.logging.Level;import java.util.logging.Logger;/** * * @author Administrator */public class yuyinclient extends Thread{            public yuyinclient(Socket s,String ip) {            this.ip = ip;            this.cli = s;        }        public int port=6002;        public int maxThreadNum=5;        private Socket cli = null;        Capture cap = null;        String ip = "";        public void run() {                    try {                        cli=new Socket(ip,6002);                        System.out.println("Server Connect!");                        cap=new Capture(cli);                        Playback player=new Playback(cli);                        cap.start();                        player.start();                    }                    catch (Exception ex) {                        ex.printStackTrace();                    }        }        public void stopclient(){        try {            cli.close();            cap.stop();        } catch (IOException ex) {            Logger.getLogger(yuyinclient.class.getName()).log(Level.SEVERE, null, ex);        }        }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?