本文整理汇总了Python中circus.sockets.CircusSocket.bind_and_listen方法的典型用法代码示例。如果您正苦于以下问题:Python CircusSocket.bind_and_listen方法的具体用法?Python CircusSocket.bind_and_listen怎么用?Python CircusSocket.bind_and_listen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类circus.sockets.CircusSocket
的用法示例。
在下文中一共展示了CircusSocket.bind_and_listen方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_socket
# 需要导入模块: from circus.sockets import CircusSocket [as 别名]
# 或者: from circus.sockets.CircusSocket import bind_and_listen [as 别名]
def test_socket(self):
if TRAVIS:
return
sock = CircusSocket('somename', 'localhost', 0)
try:
sock.bind_and_listen()
finally:
sock.close()
示例2: test_set_inheritable
# 需要导入模块: from circus.sockets import CircusSocket [as 别名]
# 或者: from circus.sockets.CircusSocket import bind_and_listen [as 别名]
def test_set_inheritable(self):
sockfile = self._get_tmp_filename()
sock = CircusSocket('somename', path=sockfile, umask=0)
try:
sock.bind_and_listen()
self.assertTrue(sock.get_inheritable())
finally:
sock.close()
示例3: test_unix_socket
# 需要导入模块: from circus.sockets import CircusSocket [as 别名]
# 或者: from circus.sockets.CircusSocket import bind_and_listen [as 别名]
def test_unix_socket(self):
sockfile = self._get_tmp_filename()
sock = CircusSocket('somename', path=sockfile, umask=0)
try:
sock.bind_and_listen()
self.assertTrue(os.path.exists(sockfile))
permissions = oct(os.stat(sockfile).st_mode)[-3:]
self.assertEqual(permissions, '777')
finally:
sock.close()
示例4: test_unix_socket
# 需要导入模块: from circus.sockets import CircusSocket [as 别名]
# 或者: from circus.sockets.CircusSocket import bind_and_listen [as 别名]
def test_unix_socket(self):
fd, sockfile = tempfile.mkstemp()
os.close(fd)
os.remove(sockfile)
sock = CircusSocket('somename', path=sockfile)
try:
sock.bind_and_listen()
self.assertTrue(os.path.exists(sockfile))
finally:
sock.close()
os.remove(sockfile)
示例5: test_unix_socket
# 需要导入模块: from circus.sockets import CircusSocket [as 别名]
# 或者: from circus.sockets.CircusSocket import bind_and_listen [as 别名]
def test_unix_socket(self):
fd, sockfile = tempfile.mkstemp()
os.close(fd)
os.remove(sockfile)
sock = CircusSocket('somename', path=sockfile, umask=0)
try:
sock.bind_and_listen()
self.assertTrue(os.path.exists(sockfile))
permissions = oct(os.stat(sockfile).st_mode)[-3:]
self.assertEqual(permissions, '777')
finally:
sock.close()
示例6: test_socket
# 需要导入模块: from circus.sockets import CircusSocket [as 别名]
# 或者: from circus.sockets.CircusSocket import bind_and_listen [as 别名]
def test_socket(self):
sock = CircusSocket("somename", "localhost", 0)
try:
sock.bind_and_listen()
finally:
sock.close()