Java Socket类库 Java Sockets

码农软件 · 软件分类 · 网络工具包 · 2019-03-02 19:11:26

软件介绍

Java Sockets is a class library implementing a subset of the C++ Sockets library, and is based on SUN's java.nio.* non-blocking network i/o classes.

示例代码

public class MySocket extends TcpSocket
{
public MySocket(SocketHandler h)
{
super(h);
SetLineProtocol();
}

public void OnConnect()
{
Send("GET / HTTP/1.0\r\n" +
"Host: www.alhem.net\r\n" +
"\r\n");
}

public void OnLine(String line)
{
System.out.println(line);
}

public static void main(String[] args)
{
StdLog log = new StdoutLog();
SocketHandler h = new SocketHandler(log);
MySocket sock = new MySocket(h);
sock.Open( "www.alhem.net", 80 );
h.Add( sock );
boolean quit = false;
while (!quit) // forever
{
h.Select(1, 0);
}
}
}

本文地址:https://codercto.com/soft/d/485.html

Viral Loop

Viral Loop

Adam L. Penenberg / Tantor Media / 2009-10-27 / USD 34.99

From Google to Facebook, a respected journalist delves into how a "viral loop" can make an online business a success.一起来看看 《Viral Loop》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具