Пример #1
0
        public ClientState(Socket socket)
        {
            try
            {
                m_Socket = socket;

                m_ClientIdentifier = Guid.NewGuid().ToString();

                m_AesModule       = new AesModule();
                m_MessageIsolator = new MessageIsolator(this, m_AesModule);

                m_AsyncCallback = new AsyncCallback(ReadCallback);

                NetworkEventDispatcher.
                InvokeClientConnectionEvent(new ClientConnectionEventArgs(this));

                Socket.BeginReceive
                    (Buffer, 0, BufferSize, 0, m_AsyncCallback, this);
            }

            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
Пример #2
0
        private static void InitializeModules()
        {
            RsaKeysLoaded = RSAModule.QueryRsa();

            m_AesModule = new AesModule();
            m_AesModule.InitializeProviderFromFile();

            MySqlConnector.InitializeMySqlPasswordFromEncrypted();
            MySqlConnection SqlConnection = MySqlConnector.InitializeMySqlConnection();

            if (SqlConnection != null)
            {
                SqlConnection.Dispose();
                Console.WriteLine
                    ("Mysql Database Connection Sucessful..");
            }
        }
Пример #3
0
 public MessageIsolator(ClientState state, AesModule aes)
 {
     m_ClientState = state;
     m_Aes         = aes;
 }