This class represents a high performance Async Tcp Socket wrapper that is used to act as a base for all Gamespy protocol Tcp connections.
Inheritance: IDisposable
        /// <summary>
        /// Creates a new instance of GamespyTcpStream
        /// </summary>
        /// <param name="ReadArgs"></param>
        public GamespyTcpStream(GamespyTcpSocket Parent, SocketAsyncEventArgs ReadArgs, SocketAsyncEventArgs WritetArgs)
        {
            // Store our connection
            Connection = ReadArgs.AcceptSocket;
            SocketManager = Parent;

            // Create our IO event callbacks
            ReadArgs.Completed += IOComplete;
            WritetArgs.Completed += IOComplete;

            // Set our internal variables
            ReadEventArgs = ReadArgs;
            WriteEventArgs = WritetArgs;
            SocketClosed = false;
            DisposedEventArgs = false;
            Released = false;
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new instance of GamespyTcpStream
        /// </summary>
        /// <param name="ReadArgs"></param>
        public GamespyTcpStream(GamespyTcpSocket Parent, SocketAsyncEventArgs ReadArgs, SocketAsyncEventArgs WritetArgs)
        {
            // Store our connection
            Connection    = ReadArgs.AcceptSocket;
            SocketManager = Parent;

            // Create our IO event callbacks
            ReadArgs.Completed   += IOComplete;
            WritetArgs.Completed += IOComplete;

            // Set our internal variables
            ReadEventArgs     = ReadArgs;
            WriteEventArgs    = WritetArgs;
            SocketClosed      = false;
            DisposedEventArgs = false;
            Released          = false;
        }