private static void server_cC(karver sender, karlient client) { Console.WriteLine("[+] Client Successfully connected!!"); client.packetReceived += client_packetReceived; client.stateChanged += client_stateChanged; client.Start(); lock (clientz) { clientz.Add(client); } }
protected static void acceptCallBack(IAsyncResult ar) { karver konteks = (karver)ar.AsyncState; try { Socket koneksi = konteks.socket.EndAccept(ar); karlient client = new karlient(koneksi); konteks.OnKlientKonnected(client); } catch (SocketException e) { } konteks.socket.BeginAccept(new AsyncCallback(acceptCallBack), konteks); }