コード例 #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;
 }