protected virtual void OnRaiseClientConnectedEvent(ClientConnectedEventArgs e) { EventHandler <ClientConnectedEventArgs> handler = RaiseClientConnectedEvent; if (handler != null) { handler(this, e); } }
private async void AcceptClients() { while (isRunning) { Client tempClient = new Client(); var client = await mListener.AcceptTcpClientAsync(); tempClient.client = client; mClients.Add(tempClient); logger.Log(LogLevel.Info, string.Format("İstemci başarılı bir şekilde bağlandı. Sayısı {0} - Ip Adresi : {1}", mClients.Count, client.Client.RemoteEndPoint)); // Client Bağlantı Eventi ClientConnectedEventArgs eaClientConnected; eaClientConnected = new ClientConnectedEventArgs(client.Client.RemoteEndPoint.ToString()); OnRaiseClientConnectedEvent(eaClientConnected); Send(client, PackageType.Header); Send(client, Headers.Authorization); Listening(client); } }