开发者

Always running TCP server on a webserver

开发者 https://www.devze.com 2023-02-02 02:28 出处:网络
I want to create a TCP Server which is always running on a webserver, so that I can connect using web browser as a client, to push data to the server. Server wont send back anything to the client, jus

I want to create a TCP Server which is always running on a webserver, so that I can connect using web browser as a client, to push data to the server. Server wont send back anything to the client, just will keep on listening whatever a web browser has to say. In which language should I code, and please give some example code also. I think Java is a good language for such task, but how will I embed it in my web based domain 开发者_开发百科server?


As always, you should code the server in whatever language you are familiar with. Obviously, for most of us, using a language like C++, Ruby, or Java is easier for a tcp server than, say, Postscript, but that has been done, too.

As for getting the server to run on the same machine as your web server, that depends on what your web server is running on. But it's a question for superuser anyway. (And if you don't know how to start a server on that machine, what exactly are you doing administering a server connected to the internet in the first place?)


I used Java to code my proxy server, that is simple and good I can handle all the requests and responses.

0

精彩评论

暂无评论...
验证码 换一张
取 消