Has anyone gotten a silverlight socket application to run successfully over the internet? Like have a console server that listens for client. The client uses silverlight sockets where users can go on any web browser and connect to the console server.
Out-of-browser applications in Silverlight 4 work with sockets just fine. Our SecureBlackbox product offers implementations for various protocols (HTTPS, FTPS, SSH/SFTP, SSL/TLS) over Silverlight socket, and they work just fine. If you want to have something in browser, you need to make/modify the server to (a) listen on the port that belongs to specific port range (4502 to 4534) and (b) accept requests on another port 943 and provide a policy file. For more information about these requirements see Microsoft document.
While I haven't had the chance or need to do so, a user group meeting I attended covered just this topic. You can watch the video of the presentation here and a copy of the code sample here.
Try example from "Pro silverlight 4 with c#" or "Pro silverlight 3 with c#". It can be downloaded from Apress.
I have used exaple for silverlight 3 and it works fine.
Related
I have questions about programming in BlackBerry Devices OS 5 - 7. Is there a listener that can listen if the device is just connected to internet connection? The task of my app is that if the device is connected, it will send a http request right away.
Looking forward to it.
Best regards,
Hammy
The listener you want is called CoverageStatusListener. Have a look at the API: CoverageStatusListener and CoverageStatusListener OS6.0+. Note the two flavours - you might want to use the extended version in your OS 6 and above apps.
But that said, coverage is only 1/2 the story. You might have good coverage but no access to the specific web site you are targeting. Another common problem is things like WiFi Hotspots - you can be talking quite happily on WiFi, but unless you have signed in to the Hotspot, you are not going to be able to communicate with your web site. So the many links that have already been provided by Signare (in the comments for your question), are useful. Here they are again, plus one more that I think is useful:
how-to-check-availability-of-internet-connectionwifi-gprs-edge-in-blackberry
how-to-check-for-an-active-internet-connection-in-blackberry-sdk
how-to-check-internet-connection-in-java-in-blackberry
how-to-check-network-connection-type-in-blackberry
I'm facing a problem that gives me a quite hard time ...
People having trouble to execute a program that needs specific ports to be open, sadly they don't know if its a clientside problem caused by blocked ports, of it its simply a software problem.
So I thought about making a program that checks if the user can access the provided ports, after I made the WPF application, I was thinking about having an easier access to such functionality and tried to produce a Silverlight Version.
Questions:
a.) Is there even a way to check if the user can connect to specific ports that aren't in the range of 4502 - 4534 within a silverlight application that runs as plugin in the web browser ?
b.) Is there a way to do this, even without having access to the specific server to provide a policy file?
If you trying to do it from the in-browser application that its a no. Trusted silverlight application should be able to connect to any port without restrictions.
If there was a process on the user's desktop, would Silverlight be able to communicate with it? Is there a way to send messages from SL to a process that runs in the background and vice versa?
P.S. I am particularly interested in non-OOB SL.
Running OOB, with Elevated Trust would allow to open a socket connection to arbitrary destinations, including a local process hosting a listen socket. Otherwise I see no way how to do it.
No. Silverlight will not allow you to deal with anything outside the web browser in non-OOB.
Silverlight -> JavaScript -> ActiveX
http://forums.silverlight.net/forums/p/17053/206880.aspx
Is it possible to make bittorrent client within silverlight, which will run in browser?
this would be unusual bittorrent client, he will download data from the server and will seed it. is it possible to do?
Is it possible to do within different, web tech, such as e.g. JavaFX?
Yes, completely possible. You can't receiving incoming connections, but that's no requirement for Bittorrent. The only thing that makes it difficult is that the peers you are connecting to need to serve a socketpolicy file on port 80 or 943, and almost none of them do. Without this policy, the Siverlight BT client will only work in the trusted 'Out of browser'-mode, which make it less usefull.
It's like a chicken-egg problem: as long as their is no large userbase for a Silverlight BT client, 'normal' nodes will not open port 943, and without that port, there never will be a large userbase for such an client.
Adobe solved this smartly by introducing Cirrus, their hosted rendezvous routing service which makes P2P possible from Flash without torrents.
No. You don't have access to the client's file system outside sandbox access.
http://betaforums.silverlight.net/forums/p/9351/29437.aspx
We currently have a silverlight application (kind of a game) and we need to add more functionality which requires more interaction with the server.
We currently do all interaction by HTTP requesting data from the server and then processing on the client - works well, until we have a lot of requests or larger data amounts being returned.
Sockets in Silverlight only work on port numbers between 4502 and 4534, is there a way of making this work on the internet? A way of allowing the user to simply accept and open up a port?
What is actually blocking the port range?
========
Just to add, is this somthing that is possible in Java (http://homepages.uel.ac.uk/2795l/pages/socketap.htm)
The only way to achieve this is via a proxy on the server or some sort of port forwarding taking place on the server.
This can not take place on the client side by itself.
What is actually blocking the port range is the SL runtime. It does this for security reasons.
In reality making use of sockets in an Internet based application would provide some hurdles most notably the need for the firewall to allow ports 4502-4534 to be open for Silverlight communication. This is one reason that the use of sockets is used more within an Intranet application where the need to open ports is non-existent (for the most part). Since Silverlight has defined these ports as the means of communication for their runtime it at least gives the admins some control over that range; versus allowing the runtime to operate on any given number of ports.
No direct way around it ( http://blogs.msdn.com/b/ncl/archive/2009/06/23/why-does-silverlight-have-a-restricted-port-range-for-sockets.aspx ).