本文整理汇总了Python中psutil.CONN_NONE属性的典型用法代码示例。如果您正苦于以下问题:Python psutil.CONN_NONE属性的具体用法?Python psutil.CONN_NONE怎么用?Python psutil.CONN_NONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类psutil
的用法示例。
在下文中一共展示了psutil.CONN_NONE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_udp_v4
# 需要导入模块: import psutil [as 别名]
# 或者: from psutil import CONN_NONE [as 别名]
def test_udp_v4(self):
addr = ("127.0.0.1", get_free_port())
with closing(bind_socket(AF_INET, SOCK_DGRAM, addr=addr)) as sock:
conn = self.check_socket(sock)
assert not conn.raddr
self.assertEqual(conn.status, psutil.CONN_NONE)
示例2: test_udp_v6
# 需要导入模块: import psutil [as 别名]
# 或者: from psutil import CONN_NONE [as 别名]
def test_udp_v6(self):
addr = ("::1", get_free_port())
with closing(bind_socket(AF_INET6, SOCK_DGRAM, addr=addr)) as sock:
conn = self.check_socket(sock)
assert not conn.raddr
self.assertEqual(conn.status, psutil.CONN_NONE)
示例3: test_unix_tcp
# 需要导入模块: import psutil [as 别名]
# 或者: from psutil import CONN_NONE [as 别名]
def test_unix_tcp(self):
with unix_socket_path() as name:
with closing(bind_unix_socket(name, type=SOCK_STREAM)) as sock:
conn = self.check_socket(sock)
assert not conn.raddr
self.assertEqual(conn.status, psutil.CONN_NONE)
示例4: test_unix_udp
# 需要导入模块: import psutil [as 别名]
# 或者: from psutil import CONN_NONE [as 别名]
def test_unix_udp(self):
with unix_socket_path() as name:
with closing(bind_unix_socket(name, type=SOCK_STREAM)) as sock:
conn = self.check_socket(sock)
assert not conn.raddr
self.assertEqual(conn.status, psutil.CONN_NONE)
# =====================================================================
# --- Test connected sockets
# =====================================================================
示例5: test_unix_tcp
# 需要导入模块: import psutil [as 别名]
# 或者: from psutil import CONN_NONE [as 别名]
def test_unix_tcp(self):
testfn = self.get_testfn()
with closing(bind_unix_socket(testfn, type=SOCK_STREAM)) as sock:
conn = self.check_socket(sock)
assert not conn.raddr
self.assertEqual(conn.status, psutil.CONN_NONE)
示例6: test_unix_udp
# 需要导入模块: import psutil [as 别名]
# 或者: from psutil import CONN_NONE [as 别名]
def test_unix_udp(self):
testfn = self.get_testfn()
with closing(bind_unix_socket(testfn, type=SOCK_STREAM)) as sock:
conn = self.check_socket(sock)
assert not conn.raddr
self.assertEqual(conn.status, psutil.CONN_NONE)