Ejemplo n.º 1
0
 void Listen(IAsyncResult ar)
 {
     var cliSkt = Socket.EndAccept(ar);
     Socket.BeginAccept(Listen, null);
     if (cliSkt != null)
     {
         var client = new Client(Manager, cliSkt);
         client.BeginProcess();
     }
 }
Ejemplo n.º 2
0
        private void Listen(IAsyncResult ar)
        {
            Socket cliSkt = null;

            if (!Socket.IsBound)
            {
                return;
            }
            try
            {
                cliSkt = Socket.EndAccept(ar);
                Socket.BeginAccept(Listen, null);
            }
            catch (ObjectDisposedException) { }
            if (cliSkt != null)
            {
                var client = new Client(Manager, cliSkt);
                client.BeginProcess();
            }
        }
Ejemplo n.º 3
0
 private static void Listen(IAsyncResult ar)
 {
     Socket skt = null;
     try
     {
         skt = svrSkt.EndAccept(ar);
     }
     catch (ObjectDisposedException)
     {
     }
     try
     {
         svrSkt.BeginAccept(Listen, null);
     }
     catch (ObjectDisposedException)
     {
     }
     if (skt != null)
     {
         var psr = new Client(skt);
         psr.BeginProcess();
     }
 }
Ejemplo n.º 4
0
        private void Listen(IAsyncResult ar)
        {
            Socket skt = null;

            try
            {
                skt = Socket.EndAccept(ar);
            }
            catch (ObjectDisposedException)
            {
            }
            try
            {
                Socket.BeginAccept(Listen, null);
            }
            catch (ObjectDisposedException)
            {
            }
            if (skt != null)
            {
                var client = new Client(Manager, skt);
                client.BeginProcess();
            }
        }