Silverlight and TCP
Is it possible for Siverlight to communicate directly with an open TCP port on the user's machin开发者_Go百科e?
in a word No.
You can use sockets (and therefore TCP) to communicate with open ports (in a limited range) on the server that is hosting the application, but you cannot connect to any other machines. if you need to interoperate with something on the client machine i would suggest using the new COM interoperability in Silverlight 4 (here is an example)
You can connect to an open TCP port on any machine that serves a security policy file or to any machine, including the local client, if Silverlight runs with elevated privileges.
Elevated privileges are not likely to be problematic as in scenarios like this you are probably developing a line of business application.
At my company I implemented the binary TCP protocol of an RFID server in Silverlight. The server must be connected to the local network and its dns name (or ip address) be known, other than that there is no problem in doing this sort of thing. It is around since Silverlight 3.
精彩评论