如何开始使用Python SCTP stack(pysctp)?

2024-09-28 21:26:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我刚刚从http://www.epx.com.br/pysctp/安装了pysctp,但是我无法使基本示例正常工作。我会做错什么?

我在Red Hat Linux上。

Python 2.7.2 (default, Oct 25 2011, 10:11:43)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> import sctp
>>> sk = sctp.sctpsocket_tcp(socket.AF_INET)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/python2.7/lib/python2.7/site-packages/sctp.py", line 1644, in __init__
    sctpsocket.__init__(self, family, TCP_STYLE, sk)
  File "/usr/local/python2.7/lib/python2.7/site-packages/sctp.py", line 1016, in __init__
    self.events = event_subscribe(self)
  File "/usr/local/python2.7/lib/python2.7/site-packages/sctp.py", line 623, in __init__
    self.__dict__.update(self.container._get_events())
  File "/usr/local/python2.7/lib/python2.7/site-packages/sctp.py", line 1356, in _get_events
    return _sctp.get_events(self._sk.fileno())
IOError: [Errno 22] Invalid argument

Tags: inpyselfgetinitlibpackagesusr