private void SyncConnect() { try { while (true) { if (Connection.Disabled) return; if (!this.enabled) return; SyncSocketWrapper sender = null; try { //String IPAdress = ""; sender = new SyncSocketWrapper(); sender.Create(this.Connection.Accept()); if (this.OnClientConnect != null) { this.OnClientConnect(sender); } sender.BeginReceive(this); } catch (SocketException e) { Program.SaveException(e); Console.WriteLine(e); } catch (ObjectDisposedException e) { Program.SaveException(e); Console.WriteLine(e); } catch (Exception e) { Program.SaveException(e); } } } catch (ThreadAbortException e) { Program.SaveException(e); Console.WriteLine(e); } }