I am trying to build a video calling application. It can either be web based or else desktop application. I've managed to produce a web based one using SilverLight, but when hosting the server part on my server (hosted by GoDaddy), the following code :
Listener_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Listener_Socket.Bind(new IPEndPoint(AddressAr[0], Port));
Listener_Socket.Listen(-1);
(mainly at .Bind statement) generates the following exception:
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)
What are my possible solutions? Also, if I am to abandon the following project, what are the best alternatives in which if possible I eliminate the need for the server to listen to new connections?
Please help me cause I need a video conference set up asap ...
Thanks
The hosting is not granting your code the permission to create and use sockets - that makes sense, because GoDaddy would not want hosted code to create and use arbitrary socket connection, it will be a security and performance nightmare.
My suggestion would be to try to use some third-party service already up and running - both Skype and MSN Messanger support video conferencing, can't you leverage that?
I think that instant messaging servers based on the XMPP protocol can suport video as well - see http://xmpp.org/about-xmpp/
You'll have much better luck if you use Flash and an RTMP server implementation somewhere. I've spent way too much time getting video conferencing working on Silverlight, and it's just not made for it. Unless you're planning to spend the next several years working around the problems, you need to run the code natively, and Flash offers that, and Silverlight doesn't.