コード例 #1
0
ファイル: Server.cs プロジェクト: sxg133/collabtool-prototype
        /// <summary>
        /// Initialize a new server
        /// </summary>
        /// <param name="addr">IP address of TCP listener</param>
        /// <param name="port">port number of TCP listener</param>
        /// <param name="serverActions">Instance of server actions class</param>
        /// <param name="clientHandler">Instance of client handler class</param>
        public Server(IPAddress addr, int port, IClientHandlerFactory clientHandlerFacotry, IServerActions serverActions = null)
        {
            this.Address = addr;
            this.Port = port;
            this.clientHandlerFactory = clientHandlerFacotry;
            this.serverActions = serverActions;

            this.listener = new TcpListener(Address, Port);
            clients = new Dictionary<string, TcpClient>();
        }
コード例 #2
0
ファイル: Server.cs プロジェクト: sxg133/collabtool-prototype
 /// <summary>
 /// Initialize a new server
 /// </summary>
 /// <param name="port">port number of TCP listener</param>
 /// <param name="serverActions">Instance of server actions class</param>
 /// <param name="clientHandler">Instance of client handler class</param>
 public Server(int port, IClientHandlerFactory clientHandlerFacotry, IServerActions serverActions = null)
     : this(IPAddress.Loopback, port, clientHandlerFacotry, serverActions)
 {
 }