Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I'm from Russia and I don't know English very well, so excuse me =)
I'm makin' a client-server application using Socket. I use C# 2008 Express in Windows 7 Pro. While debuging everything is fine. Also, compiled executables work perfectly on my computer. But when I run a Client-application on another computer (Windows XP), It throw an exeption. SocketPermission Exception. I tried adding to my code following instructions:
C#
System.Net.SocketPermission _permission1;
_permission1 = new SocketPermission(System.Security.Permissions.PermissionState.Unrestricted);
_permission1.Assert();


But exception is still throwing. So, what I need to do to solve that problem?

Oh, almost forgot, An exception appears when the socket is trying to Connect();
Posted
Comments
lukeer 20-Sep-12 5:33am    
People tend not to like seeing the same question twice[^]. Chose one place to ask and stick to it.

1 solution

Hi,

It seems like your port is not allowing to access the socket connection. You need to add Exception to allow for this port in the Firewall.

Programatically you can do that using NETSH.exe command line. But this is not preferable as it looks like malicious for Antivirus. I suggest you to prompt some message with instruction to allow for that port.

Thanks
-Amit Gajjar
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900