Giter Club home page Giter Club logo

chat's Introduction

Chat

Build

mvn clean install

master分支为二进制协议版本, protocol-websocket分支为WebSocket版本

Start

java -jar target/char.jar 9000 # ws://localhost:9000/chat

功能列表

  • 一对一聊天 (已通过测试)
  • 一对多聊天室聊天 (未测试)

Chat二进制通讯协议

字段名 偏移量 字段长度 数据类型 说明
sid 0 10 bytes string(UTF-8) 会话id
length 10 4 bytes int 数据包总长度
sent time 14 8 bytes long 发送时间, 自1970-1-1以来的秒数
type 22 2 bytes string(UTF-8) 数据包的类型
target_user_id 24 4 bytes int 消息接收者的用户id
target_room_id 28 4 bytes int 目标聊天室的id
mem_id 32 4 bytes int 发送者用户id
body 36 变长 string 消息体

chat's People

Contributors

wanghongfei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.