小编Sna*_*dez的帖子

如何创建一个python套接字列表器deamon

我想知道如何创建一个侦听帖子请求的deamon.我发现这个代码在这个链接上创建了一个deamon,但我不知道如何填充它.我通过json从Android手机发送commandes到php服务器,将其重定向到python,可以通过串口与arduino进行通信.我想知道是否有更好的解决方案,谢谢你的帮助

这是守护进程创建的代码:

    ## {{{ http://code.activestate.com/recipes/278731/ (r6)
"""Disk And Execution MONitor (Daemon)

Configurable daemon behaviors:

   1.) The current working directory set to the "/" directory.
   2.) The current file creation mode mask set to 0.
   3.) Close all open files (1024). 
   4.) Redirect standard I/O streams to "/dev/null".

A failed call to fork() now raises an exception.

References:
   1) Advanced Programming in the Unix Environment: W. Richard Stevens
   2) Unix Programming Frequently Asked Questions:
         http://www.erlenstar.demon.co.uk/unix/faq_toc.html
"""

__author__ = "Chad …
Run Code Online (Sandbox Code Playgroud)

python daemon network-programming

2
推荐指数
1
解决办法
7599
查看次数

标签 统计

daemon ×1

network-programming ×1

python ×1