Coder Social home page Coder Social logo

chatroom's Introduction

ChatRoom Demo [golang]

如何运行

启动 Server

$> go run .

在浏览器中输入 http://localhost:8080/client

注意的要点

  1. 默认的聊天室为 世界频道,默认的用户为 随机用户

  2. 聊天必须在链接后,才可以发出有效的信息;

  3. 聊天信息只能被同一个聊天室中的其他已经链接的用户看见;

不足之处

  1. 发出消息后,广播是一个遍历操作,应该有更好的方法,不然连接数高的时候,无法满足高并发需求

  2. 存储的数据结构应该有更好的方法,由于是 Demo,以及对于 Golang的不熟悉,导致使用 Go 存储数据不顺畅

ChangeLog

v 0.1.0

作为第一个 Golang 项目,熟悉 Golang的使用方法,实现了基本的在线聊天室的消息功能

chatroom's People

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.