public void Start() { ThreadManager.NewThread(() => this.ExecuteThread(), //() => msgs.Add(null), () => { }, "global syncronizer"); }
private void ProcessHandshakeAsync(Socket sckRead) { using (var h = DisposeHandle.Get(sckListen)) { ThreadManager.NewThread(() => HandshakeThread(sckRead), () => sckRead.Close(), "Incoming connection " + NetTools.GetRemoteIP(sckRead).ToString()); h.Disengage(); } }
public SocketWriter(IPEndPoint address, ActionSyncronizerProxy sync, Action <Exception, DisconnectType> errorResponse, Action onSoftDisconnect, Handshake info) { this.address = address; this.info = info; this.errorResponse = sync.Convert(errorResponse); this.onSoftDisconnect = sync.Convert(onSoftDisconnect); ThreadManager.NewThread(WritingThread, TerminateThread, "SocketWriter " + address); }
//Action<Exception> onHandshakeError; public SocketListener(ActionSyncronizerProxy sync, Action <Handshake, Socket> processConnection, Socket sckListen) { using (var h = DisposeHandle.Get(sckListen)) { this.sckListen = sckListen; this.processConnection = sync.Convert(processConnection); //this.onHandshakeError = onHandshakeError; ThreadManager.NewThread(() => ProcessThread(), () => TerminateThread(), "SocketListener " + NetTools.GetLocalIP(sckListen).ToString()); h.Disengage(); } }
public SocketReader(ActionSyncronizerProxy sync, Action <MemoryStream> messageProcessor, Action <IOException> errorResponse, Action onSoftDisconnect, Socket socketRead) { using (var h = DisposeHandle.Get(socketRead)) { this.onSoftDisconnect = sync.Convert(onSoftDisconnect); this.messageProcessor = sync.Convert(messageProcessor); this.errorResponse = sync.Convert(errorResponse); this.socketRead = socketRead; ThreadManager.NewThread(() => this.ProcessThread(), () => TerminateThread(), "SocketReader " + NetTools.GetRemoteIP(socketRead).ToString()); h.Disengage(); } }
public TimerThread(ActionSyncronizer sync) { this.sync = sync; ThreadManager.NewThread(this.TimingThread, () => { lock (synclock) endThread = true; }, "TimerThread"); }