How do scripting languages use sockets?

前端 未结 4 615
故里飘歌
故里飘歌 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:18

    The only way I can make sense of what you're asking is if you use inetd or a similar meta-server, which is configured to invoke your "service a single client" program for a specific listening port, forwarding your "single client servicer" program's stdin/stdout to the remote client.

    If that's the case:

    1) inetd runs it

    2) yes

    3) yes

    4) named pipes are one possibility

提交回复
热议问题