Пример #1
0
        public Connection(Server server, Socket acceptSocket)
        {
            conId = System.Threading.Interlocked.Increment(ref Connection.idpool);
            Socket = acceptSocket;
            serverRef = server;

            IPEndPoint ipEndPoint = acceptSocket.RemoteEndPoint as IPEndPoint;
            this.endPointIP = ipEndPoint.Address;
        }
Пример #2
0
        public static void Main(string[] args)
        {
            ushort port = 8010;
            Console.WriteLine("Creating 2000 initial client server with receive buffer size of 4096");
            Console.WriteLine("Creating 20 Accept Args");
            IPEndPoint server_ep = new IPEndPoint(IPAddress.Any, port);
            var userserver = new Thixi.Server(2000, 4096, 20);

            Console.WriteLine("Setting delegated OnNewConnection");
            userserver.OnNewConnection = OnNewUserConnection;

            Console.WriteLine("Starting TCP Server with NoDelay option set on port "+port);
            userserver.Start(server_ep, SocketOptionName.NoDelay);

            Console.ReadLine ();
        }
Пример #3
0
        public static void Main(string[] args)
        {
            ushort port = 8010;

            Console.WriteLine("Creating 2000 initial client server with receive buffer size of 4096");
            Console.WriteLine("Creating 20 Accept Args");
            IPEndPoint server_ep  = new IPEndPoint(IPAddress.Any, port);
            var        userserver = new Thixi.Server(2000, 4096, 20);

            Console.WriteLine("Setting delegated OnNewConnection");
            userserver.OnNewConnection = OnNewUserConnection;

            Console.WriteLine("Starting TCP Server with NoDelay option set on port " + port);
            userserver.Start(server_ep, SocketOptionName.NoDelay);

            Console.ReadLine();
        }
Пример #4
0
 public HttpConnection(Thixi.Server serv, Socket socket)
     : base(serv, socket)
 {
 }
Пример #5
0
 public SocketAsyncEventArgsPool(Server serverRef)
 {
     this.serverRef = serverRef;
 }
Пример #6
0
        static Thixi.Connection OnNewUserConnection(Thixi.Server serv, Socket socket)
        {
            var newconn = new HttpConnection(serv, socket);

            return(newconn);
        }
Пример #7
0
 public virtual void RefDispose()
 {
     serverRef = null;
     endPointIP = null;
 }