jtriley / pystun

A Python STUN client for getting NAT type and external IP
https://github.com/jtriley/pystun
MIT License
436 stars 154 forks source link

Remove global side effects to socket library #16

Closed b1naryth1ef closed 7 years ago

b1naryth1ef commented 9 years ago

Previously the get_ip_info function used socket.setdefaulttimeout to set the socket timeout for its query socket. This function sets the default socket timeout globally, and thus caused side effects after this function was called (in any library or code that uses sockets).

This change removes the previous setdefaulttimeout call in favor of setting the timeout directly on the socket itself.