推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
displayabc
V2EX  ›  Python

python 如何保持单个连接不断开?

  •  
  •   displayabc · Feb 5, 2015 · 4138 views
    This topic created in 4260 days ago, the information mentioned may be changed or developed.
    在弄苹果的推送,使用的socket, ssl.wrap_socket,创建一个连接之后写入,只能发送一次数据,第二次就会失败。各种搜索,搞不定了,求助啊
    Supplement 1  ·  Feb 5, 2015
    tcp不主动断开,就是连接的状态,失败的原因是因为有错误的token


    http://blog.csdn.net/tlq1988/article/details/9612237
    3 replies  •  2015-03-03 00:18:42 +08:00
    surewen
        1
    surewen  
       Feb 6, 2015 via iPhone   ❤️ 1
    理论上是可以多次推送的 但如果你推送的是无效的push id(比如用户已经卸载的)苹果就会抛异常 然后就需要你重新建立socket(以前不这样)

    正确的做法是自己维护一份无效push id的list ,人工跳过 确保发到那边的都尽可能是有效的push id
    fanta
        2
    fanta  
       Feb 6, 2015
    心跳.
    tolerious
        3
    tolerious  
       Mar 3, 2015 via iPhone
    @fanta 具体?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2484 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 02:03 · PVG 10:03 · LAX 19:03 · JFK 22:03
    ♥ Do have faith in what you're doing.