Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool BlockPort(int portToBlock)
- {
- try
- {
- Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
- IPEndPoint ep = new IPEndPoint(IPAddress.Loopback, portToBlock);
- s.Bind(ep);
- portSocketDictionary.Add(portToBlock, s);
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement