public static void main(String[] args) throws InterruptedException {
String alias = "1234";
String host = Constant.daily; //netty server host
int port = Constant.port; //netty server port
//初始化nettyclient
NettyClient netClient = NettyClientFactory.build(alias, (msg) -> {
//所有捕获的事件都会回调,客户端在此处理相应的逻辑
System.out.println("message from server... " + msg);
}).bind(host, port).start();
//android客户端写入数据到服务端
NettyClient.writeAndFlush(null);
}
-
Notifications
You must be signed in to change notification settings - Fork 1
xingducai/netty-android
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
netty-android 长连接
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published