Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0aead9f

Browse files
committed
Allow broadcast using setsockopt()
1 parent 4fab6a5 commit 0aead9f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Demo/sockets/broadcast.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
import sys, time
66
from socket import *
7+
from SOCKET import *
78

89
s = socket(AF_INET, SOCK_DGRAM)
910
s.bind('', 0)
10-
s.allowbroadcast(1)
11+
s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
1112

1213
while 1:
1314
data = `time.time()` + '\n'

0 commit comments

Comments
 (0)