1.javasocketԴ?源码????
javasocketԴ?????
//客户端
public static void main(String[] args) throws Exception
{
Socket socket = new Socket(".0.0.1", );
OutputStream os = socket.getOutputStream();
os.write("hello world".getBytes());
os.close();//客户端使用完流之后记得要关闭!!分析小程序源码传到服务器失败
}
//服务端
public static void main(String[] args) throws Exception
{
ServerSocket ss = new ServerSocket();
Socket socket = ss.accept();
InputStream is = socket.getInputStream();
byte[] buffer = new byte[];
int length = 0;
while (-1 != (length = is.read(buffer,源码慕课 源码下载 0, buffer.length)))//这句错了,是分析美业crm源码不等于!
{
String str = new String(buffer,源码网站源码的更改 0, length);
System.out.println("welcome "+str);
}
}
2025-01-08 23:55
2025-01-08 23:04
2025-01-08 22:56
2025-01-08 22:51
2025-01-08 22:33
2025-01-08 22:08