public AsyncSocketController(int tmp_Port) { try { _serverSocket = new AsyncServer(tmp_Port); } catch (Exception ex) { throw ex; } }
public AsyncSocketController(int tmp_Port) { try { _serverSocket = new AsyncServer(tmp_Port); } catch (Exception ex) { if (SocketError != null) { SocketError(ex); } } }
/// <summary> /// Entry Point /// </summary> public UsersObject() { try { _users = new List<UserObject>(); // Initialise new list of users for in memory operations _server = new AsyncServer(5999); // Listen on the port I will alwyas listen on _server.ConnectionAccept += _server_ConnectionAccept; // Wire up event _server.Start(); // Begin listening for new connections immediately } catch (Exception ex) { if (ProcessError != null) { ProcessError(ex, "UsersObject"); } } }
/// <summary> /// Close /// </summary> public void Close() { try { foreach (var user in _users) { user.CloseSocket(); } _users = new List<UserObject>(); _server.Close(); _server = null; } catch (Exception ex) { throw ex; } }
public Users() { _users = new List<User>(); _server.ConnectionAccept += _server_ConnectionAccept; _server = new AsyncServer(5999); _server.Start(); }