-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
netrsr
committed
Jun 23, 2021
1 parent
27f857d
commit fb41f36
Showing
2 changed files
with
41 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
from os import wait | ||
import socket | ||
import sctp | ||
import time | ||
|
||
sk = sctp.sctpsocket_tcp(socket.AF_INET) | ||
sk.connect(("192.168.100.9", 36412)) | ||
|
||
cli = sctp.sctpsocket_udp(socket.AF_INET) | ||
tmp = sctp.event_subscribe(cli) | ||
tmp.set_association(1) | ||
tmp.set_data_io(1) | ||
|
||
print("Sending Message") | ||
cli.autoclose = 0 # no automatic closing of the associacion | ||
|
||
sk.sctp_send(msg='hello world') | ||
sk.shutdown(0) | ||
cli_ = sctp.sctpsocket_udp(socket.AF_INET) | ||
tmp = sctp.event_subscribe(cli_) | ||
tmp.set_association(1) | ||
tmp.set_data_io(1) | ||
|
||
cli.bind(("127.0.0.1", 10001)) | ||
cli_.bind(("127.0.0.1", 10002)) | ||
cli.sctp_send(msg=b'0', to=("127.0.0.1", 10000)) | ||
cli_.sctp_send(msg=b'0', to=("127.0.0.1", 10000)) | ||
time.sleep(10) | ||
|
||
sk.close() | ||
cli.close() | ||
time.sleep(3) | ||
cli_.close() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters