Can javascript access the system ports ?
If yes, is it possible to write a server (TCP/UDP in C) to which data can be send from javascript ?
Can javascript access the system ports ? If yes, is it possible to write
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let’s assume that you’re not asking for Node.js.
You can write WebSocket server in C and connect your JavaScript to it. There are already plenty of implementations so you don’t have to write it yourself.
When you start your server and bind it to specific host name and port you can connect from your JavaScript by:
For example, here is one http://code.google.com/p/cwebsocket/.
As far as I know WebSocket is over TCP.
One more option is to create HTTP server use AJAX with or without long polling.