Python _socket.gethostbyname() Examples
The following are 6
code examples of _socket.gethostbyname().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
_socket
, or try the search function
.
Example #1
Source File: test__socket.py From ironpython2 with Apache License 2.0 | 5 votes |
def test_gethostbyname(self): '''Tests _socket.gethostbyname''' #sanity self.assertEqual(_socket.gethostbyname("localhost"), "127.0.0.1") self.assertEqual(_socket.gethostbyname("127.0.0.1"), "127.0.0.1") self.assertEqual(_socket.gethostbyname("<broadcast>"), "255.255.255.255") #negative self.assertRaises(_socket.gaierror, _socket.gethostbyname, "should never work")
Example #2
Source File: resolver_thread.py From satori with Apache License 2.0 | 5 votes |
def gethostbyname(self, *args): return self.pool.apply(_socket.gethostbyname, args)
Example #3
Source File: test__socket.py From ironpython3 with Apache License 2.0 | 5 votes |
def test_gethostbyname(self): '''Tests _socket.gethostbyname''' #sanity self.assertEqual(_socket.gethostbyname("localhost"), "127.0.0.1") self.assertEqual(_socket.gethostbyname("127.0.0.1"), "127.0.0.1") self.assertEqual(_socket.gethostbyname("<broadcast>"), "255.255.255.255") #negative self.assertRaises(_socket.gaierror, _socket.gethostbyname, "should never work")
Example #4
Source File: resolver_thread.py From PhonePi_SampleServer with MIT License | 5 votes |
def gethostbyname(self, *args): return self.pool.apply(_socket.gethostbyname, args)
Example #5
Source File: resolver_thread.py From PokemonGo-DesktopMap with MIT License | 5 votes |
def gethostbyname(self, *args): return self.pool.apply(_socket.gethostbyname, args)
Example #6
Source File: resolver_thread.py From PokemonGo-DesktopMap with MIT License | 5 votes |
def gethostbyname(self, *args): return self.pool.apply(_socket.gethostbyname, args)