Exemplo n.º 1
0
        public BaseSocket(Protocols Type)
        {
            this.Type = Type;

            events       = new EventBaseList();
            sendCommands = new SendCommandList();

            SendBufferSize    = Constants.SEND_BUFFER_SIZE;
            ReceiveBufferSize = Constants.RECEIVE_BUFFER_SIZE;

            Socket = SocketUtilities.CreateSocket(Type);
            SocketUtilities.SetBlocking(Socket, false);
            SocketUtilities.SetReceiveTimeout(Socket, Constants.RECEIVE_TIMEOUT);
            SocketUtilities.SetSendTimeout(Socket, Constants.SEND_TIMEOUT);
            SocketUtilities.SetTimeToLive(Socket, Constants.TIME_TO_LIVE);
            SocketUtilities.SetIPv6OnlyEnabled(Socket, false);
            //SocketUtilities.SetChecksumEnabled(Socket, false);

            if (Type == Protocols.TCP)
            {
                SocketUtilities.SetNagleAlgorithmEnabled(Socket, false);
            }

            Statistics = new NetworkingStatistics();

            MultithreadedCallbacks = true;
            MultithreadedReceive   = true;
            MultithreadedSend      = true;
        }
Exemplo n.º 2
0
 public Client()
 {
     Statistics = new NetworkingStatistics();
 }