I am a newbie to java scripting, hence need help. I am looking for a tcp client code written in java script that constantly reads data from a server socke开发者_开发问答t and prints to the console. Any help is highly appreciated.thanks
What environment is the Javascript client?
If it's in a browser, you can't do it, there's no support for generic TCP sockets in browsers.
However you might be able to use a WebSocket
if you're using a newer browser that supports them.
精彩评论