Client-side browser language/plugin that supports sockets?
I am a Application Developer (java,c,c#) and do not have experience with any web-based languages yet.
I want to embed an application in a webpage. The application may need to connect to a database that could be o开发者_如何学Gon the same host as the webpage.
But most importantly, I need client-side socket support (like java's Socket class).
I could relatively easily implement it using a java applet, but it seems java applets are not used very often anymore, and the java runtime is required on the clients pc.
Javascript seems like the most widely used, but is it capable of directly using the clients network?
Silverlight seems to be gaining popularity and might fit my needs, but has the same problem as java applets (not guaranteed to be installed on the client machine).
What are the other alternatives?
Thanks for your help!
Java is still alive, and I think in your case Java works better than JavaScript. I wouldn't worry so much about people having the Java runtime.. it takes a few minutes to get it and it's still very common.
The main reason here is that you already know Java well and don't have experience with web-based languages- why spend loads of time with something else?
Java applets are a bit dated though.
So the new HTML5 provides socket support(thanks Pointy), and that's the wisest choice overall(use JavaScript + HTML5 ).
After some research I think my two best options are Silverlight or a Java Applet.
Both have rich client-side capability and can be easily embedded in a web-page. Not everyone is guaranteed to have either installed but both are relatively easy to install and run on almost any desktop. No linux for silverlight though :(
This may be possible with pure HTML5/javascript as well, but would require significantly more work because you would not get the pre-made libraries of C# or Java.
Java Applets are quite dated however, and it would take a sizable amount of work to get a java applet looking like a modernly styled web app.
For that reason I decided to try out silverlight.
Thanks for all the tips!
Edit: After some further digging it seems like silverlight will not work for me since it has many restrictions on the use of client side sockets. http://msdn.microsoft.com/en-us/library/cc645032%28v=vs.95%29.aspx
A java applet would be much more flexible.
精彩评论