• 大小: 0.09M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-03-27
  • 语言: Java
  • 标签: java  

资源简介


demo,搭个tomcat就可以跑 长连接、websocket都支持,在多个浏览器测试通过

资源截图

代码片段和文件信息

package com.corundumstudio.socketio.demo;

import com.corundumstudio.socketio.AckCallback;
import com.corundumstudio.socketio.AckRequest;
import com.corundumstudio.socketio.Configuration;
import com.corundumstudio.socketio.SocketIOClient;
import com.corundumstudio.socketio.SocketIOServer;
import com.corundumstudio.socketio.VoidAckCallback;
import com.corundumstudio.socketio.listener.DataListener;

public class AckChatLauncher {

    public static void main(String[] args) throws InterruptedException {

        Configuration config = new Configuration();
        config.setHostname(“localhost“);
        config.setPort(9092);

        final SocketIOServer server = new SocketIOServer(config);
        server.addEventListener(“ackevent1“ Chatobject.class new DataListenerject>() {
            @Override
            public void onData(final SocketIOClient client Chatobject data final AckRequest ackRequest) {

                // check is ack requested by client
                // but 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\
     文件          52  2016-03-18 07:56  netty-socketio-demo-master\.gitignore
     文件        1442  2016-03-18 07:56  netty-socketio-demo-master\README.md
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\client\
     文件        3448  2016-03-18 07:56  netty-socketio-demo-master\client\ack-index.html
     文件        2723  2016-03-18 07:56  netty-socketio-demo-master\client\binary-event-index.html
     文件       99896  2016-03-18 07:56  netty-socketio-demo-master\client\bootstrap.css
     文件        2313  2016-03-18 07:56  netty-socketio-demo-master\client\event-index.html
     文件        2409  2016-03-18 07:56  netty-socketio-demo-master\client\index.html
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\client\js\
     文件       94840  2016-03-18 07:56  netty-socketio-demo-master\client\js\jquery-1.7.2.min.js
     文件       10215  2016-03-18 07:56  netty-socketio-demo-master\client\js\moment.min.js
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\client\js\socket.io\
     文件       91999  2016-03-18 07:56  netty-socketio-demo-master\client\js\socket.io\socket.io.js
     文件        4432  2016-03-18 07:56  netty-socketio-demo-master\client\namespace-index.html
     文件        2282  2016-03-18 07:56  netty-socketio-demo-master\client\ssl-event-index.html
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\server\
     文件        2159  2016-03-18 07:56  netty-socketio-demo-master\server\pom.xml
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\server\src\
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\socketio\
     目录           0  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\socketio\demo\
     文件        2286  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\socketio\demo\AckChatLauncher.java
     文件        1200  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\socketio\demo\BinaryEventLauncher.java
     文件         893  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\socketio\demo\ChatLauncher.java
     文件         610  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\socketio\demo\Chatobject.java
     文件        1017  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\socketio\demo\EventChatLauncher.java
     文件        1458  2016-03-18 07:56  netty-socketio-demo-master\server\src\main\java\com\corundumstudio\socketio\demo\NamespaceChatLauncher.java
............此处省略3个文件信息

评论

共有 条评论