Python snips
Memory aid to remember how I did stuff in Python, C++, Linux and Windows.
Tuesday, January 4, 2011
UDP sendto recvfrom
import socket
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
msg="GET http://www.google.co.in/ HTTP/1.0\r\n\r\n"
s.sendto(msg,("www.google.co.in", 80))
reply, add=s.recvfrom(1024)
# Hehe nice try cause google accepts only tcp !!
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment