标签:实现 config socket ESS news tail wss data html
var wsSer = new WebSocketServer(); wsSer.NewMessageReceived += wsSer_NewMessageReceived;//有消息传入时事件 wsSer.NewSessionConnected += wsSer_NewSessionConnected;//当有客户端连入事件 wsSer.SessionClosed += wsSer_SessionClosed;//当客户端关闭时 wsSer.NewDataReceived += wsSer_NewDataReceived;//当有数据传入时事件 if (wsSer.Setup(10086))//绑定端口 wsSer.Start();//启动服务
上面的代码的并发最大100,因为Setup函数默认就是100,以下代码实现10万的并发。
var wsSer = new WebSocketServer(); wsSer.NewMessageReceived += wsSer_NewMessageReceived;//有消息传入时事件 wsSer.NewSessionConnected += wsSer_NewSessionConnected;//当有客户端连入事件 wsSer.SessionClosed += wsSer_SessionClosed;//当客户端关闭时 wsSer.NewDataReceived += wsSer_NewDataReceived;//当有数据传入时事件 var config = new ServerConfig(); config.Port = 10086; config.Ip = "127.0.0.1"; config.MaxConnectionNumber = 100000;//最大并发数量 if (wsSer.Setup(config))//绑定端口 wsSer.Start();//启动服务
原文 http://www.itxst.com/detail/jefuqnzj.html
SuperSocket SuperWebSocket并发数100限制的问题
标签:实现 config socket ESS news tail wss data html
原文地址:https://www.cnblogs.com/logspool/p/10611887.html