python的socket底层是怎样实现的?我看_socket的类方法全是pass?
class SocketType(object):
def bind(self, address): # real signature unknown; restored from __doc__
"""
bind(address)
Bind the socket to a local address. For IP sockets, the address is a
pair (host, port); the host must refer to the local host. For raw packet
sockets the address is a tuple (ifname, proto [,pkttype [,hatype]])
"""
pass
def close(self): # real signature unknown; restored from __doc__
"""
close()
Close the socket. It cannot be used after this call.
"""
pass
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个模块是用C实现的,没有Python源码。
你要看c的源码的话:https://github.com/python/cpy...
这个大概是父类,具体的实现在其他类或者是用C语言拓展实现的