Exemplo n.º 1
0
        //Constructs backend modules
        private void ConstructBackend()
        {
            connector = new SSLConnector(IP, PORT); //Connect to server!
            connector.Connect();
            IPAddress ip = connector.getIP();

            writer         = new SSLWriter(connector.SslStream);
            streamListener = new SSLListener(connector.SslStream);
            messagehandler = new Messagehandler();
            logCrypto      = new ClientCrypto();
            p2pConnector   = new P2PConnector();
        }
Exemplo n.º 2
0
 public void Subscribe(Messagehandler mh, P2PConnector p2pc)
 {
     messageHandler               = mh;
     mh.IncommingClientMessage   += new EventHandler(IncommingMessage);
     mh.IncommingLoginAck        += new EventHandler(LoggingIn);
     mh.IncommingFriendRequest   += new EventHandler(ReceivedFriendRequest);
     mh.IncommmingFriendResponse += new EventHandler(ReceivedFriendResponse);
     mh.OutgoingP2P              += new EventHandler(ReceivedP2PResponse);
     mh.NewStatusUpdate          += new EventHandler(ReceivedStatusUpdate);
     contactsHandler.Subscribe(mh);
     p2pc.IncommingConnection += new EventHandler(NewP2PConnection);
     mh.DisconnectP2P         += new EventHandler(DisposeP2PConnection);
     mh.FileResponse          += new EventHandler(ReceivedFileResponse);
     mh.FileRequest           += new EventHandler(ReceivedFileRequest);
 }
Exemplo n.º 3
0
        public ChatWindowDriver(SSLWriter writer, ClientCrypto logCrypto)
        {
            userlist       = new List <string>();
            this.writer    = writer;
            this.logCrypto = logCrypto;
            fileManager    = new FileManager();
            p2pConnector   = new P2P.P2PConnector();

            contactsHandler       = new ContactsHandler(fileManager);
            spam                  = new SpamProtector();
            individualChatDrivers = new List <IndividualChatDriver>();
            chatWindow            = new ChatWindow();
            graphicsDriver        = new ChatWindowGraphicsDriver(chatWindow);
            friendrequest         = new FriendRequest();
            SetupListeners();
            username = ClientDriver.globalUsername;
        }