How do scripting languages use sockets?

前端 未结 4 650
故里飘歌
故里飘歌 2021-01-07 12:00

Python, Perl and PHP, all support TCP stream sockets. But exactly how do I use sockets in a script file that is run by a webserver (eg Apache), assuming I only have FTP acce

4条回答
  •  一个人的身影
    2021-01-07 12:17

    When a client connects to a specific port, how does the script file get invoked?

    The script should be already invoked in order to receive any connects from any client. You will need script to be hanging on there forever (infinie loop) and setup Apache not to kill it on timeout. Basically, PHP is not a good choice for writting server applications. Why do you need this?

提交回复
热议问题