⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cl.java

📁 java socket server,对初学者很好的参考意义
💻 JAVA
字号:
// test of the client class// Keith Vertanen, 11/98import java.io.*;import java.net.*;import Client;public class cl {   static int SIZE = 1024;   // how big the array of data is   static int ITERS = 20;    // how many messages to bounce back and forth   public static void main( String args[] ) throws IOException   {	// connect to the server, first number is the port, second	// is the system name, third is whether you want reversed	// bytes or not	Client myclient = new Client(5007, "bee12.cs.orst.edu", 1);	System.out.println(myclient.recv_string('\n'));	myclient.send_string("We read you 5 by 5\n");	double C[];	C = new double[SIZE];	for (int i=0; i<SIZE; i++)		C[i] = 0.0;	for (int i=0; i<ITERS; i++)	{		myclient.recv_doubles(C, SIZE);		myclient.send_doubles(C, SIZE);		System.out.print(i+" ");	}	myclient.closesocket();	   }}

⌨️ 快捷键说明

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