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(); }
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); }
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); }
public RoomManager(Connection connection, CallBackContainer callBackContainer) : this(connection) { _callBackContainer = callBackContainer; }