脚本如下: # -*- coding:utf-8 -*- ''' @Author: Stefan @File: server_listener.py @Date: 2016-11-09 If you execute this test script on servers, you have to modify the system parameter below: sysctl net.ipv4.tcp_tw_recycle=1 ''' import sys sys.path.append('/
day36 死锁现象与递归锁 死锁现象 是指两个或两个以上的进程或线程在执行过程中,因争夺资源而造成的一种互相等待的现象,若无外力作用,它们都将无法推进下去.此时称系统处于死锁状态或系统产生了死锁,这些永远在互相等待的进程称为死锁进程,如下就是死锁 from threading import Thread from threading import Lock import time lock_A = Lock() lock_B = Lock() class MyThread(Thread): d
小程序后台隐藏后 socket 无法重新连接 连接时 fail 回调函数的事件参数:connectSocket:fail:jsapi has no permission,event=createSocketTask,runningState=suspend,permissionMsg=permission ok,detail=network api interrupted in suspend state 错误原因:小程序后台切换前台时,需要时间,这个错误表示连接时小程序还不是处于前台状态,无法