Silverlight sockets: mimic framework Bind, Listen and Accept methods?

点点圈 提交于 2019-12-21 21:41:10

问题


I have this .NET Framework C# class that practically acts as a wrapper for TCP connections around the Socket class in the System.Net.Sockets namespace.

Recently I have migrated the API of this wrapper class to Silverlight, but because of the limitations of the Socket class in Silverlight, as well as the normal trust restrictions with respect to avaiable ports, client access policy etc., I have only implemented network client support in my Silverlight version.

Now, with Silverlight 5 (RC), it has become possible to apply elevated trust even for in-browser SL applications, which removes all the port and client access policy restrictions that I had to adhere to in SL 4.

My question is, if there is also a way to implement some kind of network server support in my SL wrapper class? More specifically, is there a way in Silverlight to mimic the Bind, Listen and Accept methods of the .NET Framework Socket class?

To mimic Socket.Connect, I have used the ConnectAsync method in the Silverlight Socket class. Could something similar be done for the Bind/Listen/Accept methods using e.g. Receive(From)Async?

Thanks in advance.

来源:https://stackoverflow.com/questions/7490423/silverlight-sockets-mimic-framework-bind-listen-and-accept-methods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!