Python _socket.getnameinfo() Examples
The following are 6
code examples of _socket.getnameinfo().
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 | 6 votes |
def test_getnameinfo(self): '''Tests _socket.getnameinfo()''' #sanity _socket.getnameinfo(("127.0.0.1", 80), 8) _socket.getnameinfo(("127.0.0.1", 80), 9) host, service = _socket.getnameinfo( ("127.0.0.1", 80), 8) self.assertEqual(service, '80') host, service = _socket.getnameinfo( ("127.0.0.1", 80), 0) self.assertEqual(service, "http") #IP gives a TypeError #self.assertRaises(SystemError, _socket.getnameinfo, ("127.0.0.1"), 8) #self.assertRaises(SystemError, _socket.getnameinfo, (321), 8) self.assertRaises(TypeError, _socket.getnameinfo, ("127.0.0.1"), '0') self.assertRaises(TypeError, _socket.getnameinfo, ("127.0.0.1", 80, 0, 0, 0), 8) self.assertRaises(_socket.gaierror, _socket.getnameinfo, ('no such host will ever exist', 80), 8)
Example #2
Source File: test__socket.py From ironpython3 with Apache License 2.0 | 6 votes |
def test_getnameinfo(self): '''Tests _socket.getnameinfo()''' #sanity _socket.getnameinfo(("127.0.0.1", 80), 8) _socket.getnameinfo(("127.0.0.1", 80), 9) host, service = _socket.getnameinfo( ("127.0.0.1", 80), 8) self.assertEqual(service, '80') host, service = _socket.getnameinfo( ("127.0.0.1", 80), 0) self.assertEqual(service, "http") #IP gives a TypeError #self.assertRaises(SystemError, _socket.getnameinfo, ("127.0.0.1"), 8) #self.assertRaises(SystemError, _socket.getnameinfo, (321), 8) self.assertRaises(TypeError, _socket.getnameinfo, ("127.0.0.1"), '0') self.assertRaises(TypeError, _socket.getnameinfo, ("127.0.0.1", 80, 0, 0, 0), 8) self.assertRaises(_socket.gaierror, _socket.getnameinfo, ('no such host will ever exist', 80), 8)
Example #3
Source File: resolver_thread.py From satori with Apache License 2.0 | 5 votes |
def getnameinfo(self, *args, **kwargs): return self.pool.apply(_socket.getnameinfo, args, kwargs)
Example #4
Source File: resolver_thread.py From PhonePi_SampleServer with MIT License | 5 votes |
def getnameinfo(self, *args, **kwargs): return self.pool.apply(_socket.getnameinfo, args, kwargs)
Example #5
Source File: resolver_thread.py From PokemonGo-DesktopMap with MIT License | 5 votes |
def getnameinfo(self, *args, **kwargs): return self.pool.apply(_socket.getnameinfo, args, kwargs)
Example #6
Source File: resolver_thread.py From PokemonGo-DesktopMap with MIT License | 5 votes |
def getnameinfo(self, *args, **kwargs): return self.pool.apply(_socket.getnameinfo, args, kwargs)