/// <summary> /// Tries to get the <see cref="WebSocketService"/> associated with the specified <paramref name="id"/>. /// </summary> /// <returns> /// <c>true</c> if the <see cref="WebSocketServiceManager"/> manages the <see cref="WebSocketService"/> with the specified <paramref name="id"/>; otherwise, <c>false</c>. /// </returns> /// <param name="id"> /// A <see cref="string"/> that contains the ID to find. /// </param> /// <param name="service"> /// When this method returns, contains the <see cref="WebSocketService"/> with the specified <paramref name="id"/>, if the <paramref name="id"/> is found; otherwise, <see langword="null"/>. /// </param> public bool TryGetWebSocketService(string id, out WebSocketService service) { lock (_syncRoot) { return(_services.TryGetValue(id, out service)); } }
public bool TryGetByID(string id, out WebSocketService service) { lock (_syncRoot) { return _sessions.TryGetValue(id, out service); } }
public void Clear() { ID = default(int); sClient = null; //User.Logout(); User = null; }
public string Add(WebSocketService service) { lock (_syncRoot) { if (_isStopped) return null; var id = createID(); _sessions.Add(id, service); return id; } }
internal string Add(WebSocketService service) { lock (_syncRoot) { if (_isStopped) { return(null); } var id = createID(); _services.Add(id, service); return(id); } }
public string Add(WebSocketService service) { lock (_syncRoot) { if (_isSJdped) { return(null); } var id = createID(); _sessions.Add(id, service); return(id); } }
public Session(WebSocketService _cl) { sClient = _cl; User = new User(ID); }
internal string Add(WebSocketService service) { lock (_syncRoot) { if (_isStopped) return null; var id = createID(); _services.Add(id, service); return id; } }
/// <summary> /// Tries to get the <see cref="WebSocketService"/> associated with the specified <paramref name="id"/>. /// </summary> /// <returns> /// <c>true</c> if the <see cref="WebSocketServiceManager"/> manages the <see cref="WebSocketService"/> with the specified <paramref name="id"/>; otherwise, <c>false</c>. /// </returns> /// <param name="id"> /// A <see cref="string"/> that contains the ID to find. /// </param> /// <param name="service"> /// When this method returns, contains the <see cref="WebSocketService"/> with the specified <paramref name="id"/>, if the <paramref name="id"/> is found; otherwise, <see langword="null"/>. /// </param> public bool TryGetWebSocketService(string id, out WebSocketService service) { lock (_syncRoot) { return _services.TryGetValue(id, out service); } }
internal void StartSession(WebSocketContext context) { WebSocketService webSocketService = this.CreateSession(); webSocketService.Start(context, this.Sessions); }
public static void register_service(string name, WebSocketService wss) { service_dic[name] = wss; }
internal bool TryGetServiceInstance(string id, out WebSocketService service) { lock (_sync) { return _sessions.TryGetValue (id, out service); } }
internal string Add(WebSocketService session) { lock (_sync) { if (_stopped) return null; var id = createID (); _sessions.Add (id, session); return id; } }
public string Add(WebSocketService service) { lock (_syncRoot) { if (_isSJdped) return null; var id = createID(); _sessions.Add(id, service); return id; } }