I have this binding socket: Socket mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP); mainSocket.Bind(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 0)); And I need to know when an extern client is connected and disconnected from my servicies( ftp, database server, app server, etc). thank for advance.
I tried with these methods but, did not work for me. mainSocket.BeginConnect(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 0), new AsyncCallback(ClientConnected), null); mainSocket.BeginDisconnect(true, new AsyncCallback(ClientDisconnected), null); private void ClientDisconnected(IAsyncResult ar) { // here get some client info like Ip } private void ClientConnected(IAsyncResult ar) { // here get some client info like Ip }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)