- 授权协议: BSD
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://github.com/aerofs/jssmp
软件介绍
jssmp 是 Java 版 SSMP 开源实现。
依赖:
JDK 1.8 or higher
netty 3.10+
slf4j 1.7+
guava 17+
客户端
// given: SSLEngine sslEngine;
SSMPClient c = new SSMPClient("localhost", 1234, new HashedWheelTimer(),
new NioClientSocketChannelFactory(), () -> new SslHandler(sslEngine),
e -> System.out.println("event: " + e));
c.connect(SSMPIdentifier.fromInternal("foo"),
SSMPIdentifier.fromInternal("secret"), "NotARealSecret",
new ConnectionListener() {
@Override public void connected() { System.out.println("connected"); }
@Override public void disconnected() { System.out.println("disconnected"); }
});
SSMPResponse r = c.request(SSMPRequest.ucast(SSMPIdentifier.fromInternal("bar"),
"Hello World!")).get();
System.out.println("response: " + r);服务器端
// given: SSLEngine sslEngine;
SSMPServer s = new SSMPServer(new InetSocketAddress("localhost", 1234),
new HashedWheelTimer(), new NioServerSocketChannelFactory(),
() -> new SslHandler(sslEngine),
new Authenticator() {
@Override public boolean authenticate(SSMPIdentifier id, SSMPIdentifier scheme, String cred) {
return scheme.toString().equals("secret") && cred.equals("NotARealSecret");
}
@Override public ChannelBuffer unauthorized() {
return ChannelBuffers.wrappedBuffer("401 secret\n".getBytes(StandardCharsets.US_ASCII));
}
});
s.start();
Linux/UNIX系统编程手册
Michael Kerrisk / 孙剑 许从年 董健、孙余强 郭光伟 陈舸 / 人民邮电出版社 / 2014-1 / 158
《linux/unix系统编程手册(上、下册)》是介绍linux与unix编程接口的权威著作。linux编程资深专家michael kerrisk在书中详细描述了linux/unix系统编程所涉及的系统调用和库函数,并辅之以全面而清晰的代码示例。《linux/unix系统编程手册(上、下册)》涵盖了逾500个系统调用及库函数,并给出逾200个程序示例,另含88张表格和115幅示意图。 《li......一起来看看 《Linux/UNIX系统编程手册》 这本书的介绍吧!
