import os
import errno
import ctypes
libc = ctypes.CDLL("libc.so.6")
DATA_RECEIVED='DATA RECEIVED'
DATA_SENT='DATA SENT'
try:
if not server:
server=self._server
libc.res_init()
for ai in socket.getaddrinfo(server[0],server[1],socket.AF_UNSPEC,socket.SOCK_STREAM):
self._sock=socket.socket(*ai[:3])