Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
socket Namespace Reference

Data Structures

class  _socketobject
 
class  _fileobject
 

Functions

def socket
 
def ssl
 
def getfqdn
 

Variables

list __all__ = ["getfqdn"]
 
 _realsocketcall = _socket.socket
 
 _realsslcall = _socket.ssl
 
dictionary errorTab = {}
 
tuple _socketmethods
 

Function Documentation

def socket.getfqdn (   name = '')
Get fully qualified domain name from name.

An empty argument is interpreted as meaning the local host.

First the hostname returned by gethostbyaddr() is checked, then
possibly existing aliases. In case no FQDN is available, hostname
is returned.

Definition at line 91 of file socket.py.

91 
92 def getfqdn(name=''):
93  """Get fully qualified domain name from name.
94 
95  An empty argument is interpreted as meaning the local host.
96 
97  First the hostname returned by gethostbyaddr() is checked, then
98  possibly existing aliases. In case no FQDN is available, hostname
99  is returned.
100  """
101  name = name.strip()
102  if not name or name == '0.0.0.0':
103  name = gethostname()
104  try:
105  hostname, aliases, ipaddrs = gethostbyaddr(name)
106  except error:
107  pass
108  else:
109  aliases.insert(0, hostname)
110  for name in aliases:
111  if '.' in name:
112  break
113  else:
114  name = hostname
115  return name
116 
117 
118 #
119 # These classes are used by the socket() defined on Windows and BeOS
120 # platforms to provide a best-effort implementation of the cleanup
121 # semantics needed when sockets can't be dup()ed.
122 #
123 # These are not actually used on other platforms.
124 #
def socket.socket (   family,
  type,
  proto = 0 
)

Definition at line 55 of file socket.py.

References _realsocketcall.

55 
56  def socket(family, type, proto=0):
57  return _socketobject(_realsocketcall(family, type, proto))
def socket.ssl (   sock,
  keyfile = None,
  certfile = None 
)

Definition at line 63 of file socket.py.

References _realsslcall.

63 
64  def ssl(sock, keyfile=None, certfile=None):
65  if hasattr(sock, "_sock"):
66  sock = sock._sock
67  return _realsslcall(sock, keyfile, certfile)
68 
69 
# WSA error codes

Variable Documentation

list __all__ = ["getfqdn"]

Definition at line 45 of file socket.py.

_realsocketcall = _socket.socket

Definition at line 53 of file socket.py.

_realsslcall = _socket.ssl

Definition at line 59 of file socket.py.

tuple _socketmethods
Initial value:
1 = (
2  'bind', 'connect', 'connect_ex', 'fileno', 'listen',
3  'getpeername', 'getsockname', 'getsockopt', 'setsockopt',
4  'recv', 'recvfrom', 'send', 'sendall', 'sendto', 'setblocking', 'shutdown')

Definition at line 125 of file socket.py.

dictionary errorTab = {}

Definition at line 71 of file socket.py.