Commit 849d70fa authored by Guido van Rossum's avatar Guido van Rossum

fix bind arg

parent b6c48336
...@@ -7,7 +7,7 @@ from socket import * ...@@ -7,7 +7,7 @@ from socket import *
from SOCKET import * from SOCKET import *
s = socket(AF_INET, SOCK_DGRAM) s = socket(AF_INET, SOCK_DGRAM)
s.bind('', 0) s.bind(('', 0))
s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1) s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
while 1: while 1:
......
...@@ -73,7 +73,7 @@ def openmcastsock(group, port): ...@@ -73,7 +73,7 @@ def openmcastsock(group, port):
s.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1) s.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
# #
# Bind it to the port # Bind it to the port
s.bind('', port) s.bind(('', port))
# #
# Look up multicast group address in name server # Look up multicast group address in name server
# (doesn't hurt if it is already in ddd.ddd.ddd.ddd format) # (doesn't hurt if it is already in ddd.ddd.ddd.ddd format)
......
...@@ -6,7 +6,7 @@ import sys ...@@ -6,7 +6,7 @@ import sys
from socket import * from socket import *
s = socket(AF_INET, SOCK_DGRAM) s = socket(AF_INET, SOCK_DGRAM)
s.bind('', MYPORT) s.bind(('', MYPORT))
while 1: while 1:
data, wherefrom = s.recvfrom(1500, 0) data, wherefrom = s.recvfrom(1500, 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment