Skip to content

Commit 5f169ec

Browse files
authored
Merge pull request #34 from p1-ra/feature/use-adaptation-value-as-default-adaptation-value
Use socket adaptation (~ppid) option as default ppid value in sctp_send()
2 parents ab1e97d + 4104beb commit 5f169ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sctp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ def getladdrs(self, assoc_id = 0): # -> tuple of sockaddrs as strings
11121112

11131113
return _sctp.getladdrs(self._sk.fileno(), assoc_id)
11141114

1115-
def sctp_send(self, msg, to=("",0), ppid=0, flags=0, stream=None, timetolive=None, context=0,
1115+
def sctp_send(self, msg, to=("",0), ppid=None, flags=0, stream=None, timetolive=None, context=0,
11161116
record_file_prefix="RECORD_sctp_traffic", datalogging = False):
11171117
"""
11181118
Sends a SCTP message. While send()/sendto() can also be used, this method also
@@ -1157,6 +1157,9 @@ def sctp_send(self, msg, to=("",0), ppid=0, flags=0, stream=None, timetolive=Non
11571157
The application must configure this buffer accordingly.
11581158
"""
11591159

1160+
if ppid is None:
1161+
ppid = self.adaptation
1162+
11601163
if timetolive is None:
11611164
timetolive = self._ttl
11621165

0 commit comments

Comments
 (0)