Python - sockets

 
Vista:

sockets

Publicado por Felix (2 intervenciones) el 12/12/2016 15:18:00
Hola, intento crear un socket asi:

1
2
3
4
5
6
7
8
import socket
 
print("Creacion de socket...")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print('socket efectuado')
print('conexion al host remoto')
s.connect(('www.ediciones-eni.com', 80))
print('conexion efectuada')

Y obtengo este error:

Creacion de socket...
Traceback (most recent call last):
File "D:\Python\HackingYForensic\Capitulo2\CreacionSocket\src\socket.py", line 6, in <module>
import socket
File "D:\Python\HackingYForensic\Capitulo2\CreacionSocket\src\socket.py", line 9, in <module>
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
AttributeError: module 'socket' has no attribute 'AF_INET'


Utilizo python 3 y Eclipse. Muchas gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder