Guest User

Setting Up Socket

a guest
Feb 20th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #Create sockets with settings
  2. recv_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp)
  3. recv_socket.settimeout(5)
  4. recv_socket.bind(("",port))
  5.  
  6. send_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, udp)
  7. send_socket.setsockopt(socket.SOL_IP, socket.IP_TTL, ttl)
  8. curr_addr = None
  9. curr_name = None
  10. send_socket.sendto("",(dest_name, port))
Advertisement
Add Comment
Please, Sign In to add comment