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://www.codercto.com/soft/d/485.html

Rapid Web Applications with TurboGears

Rapid Web Applications with TurboGears

Mark Ramm、Kevin Dangoor、Gigi Sayfan / Prentice Hall PTR / 2006-11-07 / USD 44.99

"Dear PHP, It's over between us. You can keep the kitchen sink, but I want my MVC. With TurboGears, I was able to shed the most heinous FileMaker Pro legacy 'solu-tion' imaginable. It has relationshi......一起来看看 《Rapid Web Applications with TurboGears》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具