我正在尝试构建一个视频通话应用程序。它可以是基于 Web 的,也可以是桌面应用程序。我已经设法使用 SilverLight 制作了一个基于 Web 的,但是在我的服务器(由 GoDaddy 托管)上托管服务器部分时,以下代码:
Listener_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Listener_Socket.Bind(new IPEndPoint(AddressAr[0], Port));
Listener_Socket.Listen(-1);
(主要在 .Bind 语句处)产生以下异常:
Request for the permission of type 'System.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at WebApplication3.SocketCoderVideoServer.Start_A_Server_On(Int32 Port)
我可能的解决方案是什么?另外,如果我要放弃以下项目,如果可能的话,最好的替代方案是什么,我消除了服务器监听新连接的需要?
请帮助我,因为我需要尽快设置视频会议...
谢谢