import socket
print "server is starting"
sock=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind=(('172.25.30.242',8080))
sock.listen(5)
print "server is listening port 8080"
while True:
connection,address = sock.accept()
try:
connection.settimeout(50)
while True。。。。
powershell里边运行时总是出现以下的错误,总是绑定那块出问题
server is starting
Traceback (most recent call last):
File "C:\Users\PC\Desktop\test2.py", line 6, in <module>
sock.bind=(('172.25.30.242',8080))
AttributeError: '_socketobject' object attribute 'bind' is read-only