예제 #1
0
 public RoomManager(Connection connection)
 {
     _logger = ObjectFactory.GetInstance<ILogger<RoomManager>>();
     _connection = connection;
     _mucManager  = new MucManager (_connection);
     _messageGrabber = new MessageGrabber(connection);
     _presenceGrabber = new PresenceGrabber(connection);
     _callBackContainer = new CallBackContainer();
 }
예제 #2
0
        public void InitializeConnection_ReceiveMessage()
        {
            var callBackContainer = new CallBackContainer <Socket>();

            _connectInitializer.NewSocketEvent += (sender, socket) => callBackContainer.CallBackMethod(sender, socket);

            var tcpConnector = new TcpClient(Dns.GetHostName(), StartupInfo.PortNum);

            callBackContainer.WaitForCallBack(1000);

            Assert.True(callBackContainer.ReceivedCallBack);
            Assert.NotNull(callBackContainer.CallBackObject);
        }
예제 #3
0
        public TcpMessagingTests()
        {
            StartupInfo.PortNum = 54231;
            _connectionInitializationListener = new ConnectionInitializationListener();
            _tcpClient = new TcpClient();
            var callBackContainer = new CallBackContainer <Socket>();

            _connectionInitializationListener.NewSocketEvent += callBackContainer.CallBackMethod;

            _tcpClient.Connect(Dns.GetHostName(), StartupInfo.PortNum);

            callBackContainer.WaitForCallBack(1000);

            _tcpConnectionHandler = new TcpConnectionHandler(callBackContainer.CallBackObject);
        }
예제 #4
0
 public RoomManager(Connection connection, CallBackContainer callBackContainer)
     : this(connection)
 {
     _callBackContainer = callBackContainer;
 }