问题
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