コード例 #1
0
        public ActionResult <JsonResponses> PreConnect([FromForm] string appId, [FromForm] string userId, [FromForm] Guid?websocketId)
        {
            if (websocketId == null)
            {
                websocketId = Guid.NewGuid();
            }
            ClientVo clientVo = new ClientVo()
            {
                AppId  = appId,
                UserId = userId,
                AppIp  = this.Ip,
            };
            var wsserver = WebSocketProxyAgent.PrevConnectServer(websocketId.Value, JsonConvert.SerializeObject(clientVo));

            return(new JsonResponses(new ConnectVo()
            {
                Server = wsserver,
                WebsocketId = websocketId
            }));
        }
コード例 #2
0
 public ActionResult <JsonResponses> SendChannelMessage([FromForm] Guid websocketId, [FromForm] string channel, [FromForm] string message)
 {
     WebSocketProxyAgent.SendChannelMessage(websocketId, channel, message);
     return(JsonResponses.Success);
 }
コード例 #3
0
 public ActionResult <JsonResponses> SubscrChannel([FromForm] Guid websocketId, [FromForm] string channel)
 {
     WebSocketProxyAgent.SubscribeChannel(websocketId, channel);
     return(JsonResponses.Success);
 }
コード例 #4
0
        public ActionResult <JsonResponses> GetChannels()
        {
            List <OnlineChannelVo> onlineChannelVos = WebSocketProxyAgent.GetChannelList().ToList();

            return(new JsonResponses(onlineChannelVos));
        }