java制作的C/S程序

源代码在线查看: csclient.java

软件大小: 7 K
上传用户: IsabellaJ
关键词: java 程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				import java.io.*;
				import java.net.*;
				public class CSClient extends Thread
				{
					String hostIp="192.168.18.2";
					int port=8888;
					Socket socket=null;
					public CSClient()
					{
					}
					public CSClient(String hostIP,int port)
					{
						try
						{
							this.hostIp=hostIP;
							this.port=port;
							socket=new Socket(hostIP,port);
							UserThread userThread= new UserThread(socket);
							userThread.start();
						}
						catch(Exception e)
						{
							System.out.println(e.toString());
						}
					}
					public static void main(String[] args)
					{
						CSClient client=new CSClient("192.168.18.2",6666);
						client.start();
					}
				}
							

相关资源