|
-
July 21st, 2012, 08:29 AM
#1
problem
#!/usr/bin/python
import socket
sock = socket.socket(socket.AF_INET,socket.SOCK_RAW,socket.IPPROTO_TCP)
while 1:
print sock.recvfrom(65565)
sock.close()
i run that prog but why its gives error (10022 invalid argument)on recvfrom(65565) i also changed it like recvfrom(1024) but its gives error i run it on windows xp sp2i also tried bind with it but that type its give error on bind like
#!/usr/bin/python
import socket
sock = socket.socket(socket.AF_INET,socket.SOCK_RAW,socket.IPPROTO_TCP)
host = "192.168.1.2"
port = 0
sock.bind((host,port))
while 1:
print sock.recvfrom(65565)
sock.close()
that time its gives error (10022 invalid argument)on bind tell why its coming
-
July 21st, 2012, 11:05 AM
#2
Re: problem
Port numbers are just 16 bits so 65565 is not valid.
-
July 21st, 2012, 02:35 PM
#3
Re: problem
65565 is buffer size
-
July 21st, 2012, 03:38 PM
#4
Re: problem
Oh, I assumed it was the port since it was close to 16 bit max value. Sorry.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|