我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

用golang socketio包计算房间中的插座数量

How do you count the number of sockets in a room in Golang. With socketio in nodejs it appears you can do this:

io.of('/chat').sockets.length

How do you do the same with the socketio library for Golang?

You basically can't. There is no method in the API that accepts a room and returns the number of sockets.

Post a feature request on the project github page.

近期文章

  • 转到模板循环(排列)出注释
  • 转到:使用-u命令安装软件包
  • 在子包中引用包main
  • 可以使用Gomega来模拟示例测试吗?
  • Golang Mgo通过ID(Mongodb)填充嵌套结构
  • 在Go程序中嵌入C ++可执行函数
  • 有关树木和GC的性能建议
  • 如何在地图上使用类似ORM的查询?
  • 导入mgo驱动程序时出错
  • 给定一组IP地址范围,其中包含给定IP地址的所有范围
  • 在对Go代码进行性能分析时,如何在结果中获得更大的粒度?
  • Redis实例经常使用Go-lang Client Redigo丢失缓存
  • 如何使用“ slashUrls”代替QueryString。 (不订购)
  • 如何使用Go接口测试Google API Golang库?
  • 包的所有方法以Go语言返回的错误列表
  • 更改Gopacket的IP地址并使用原始套接字重新传输
  • Go软件包二进制参考
  • asn1 go(客户端证书身份验证)
  • golang编辑先前设置的标志。 MySQL错误1045
  • 在golang中使用google-api-go-client更新视频内编程

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华