Errno 111 : Connection refused

Help and Assistance requestes

Errno 111 : Connection refused

Postby ADuval » Fri Oct 19, 2018 3:20 pm

Hello,

Did someone encounter this error sometimes?
It happens totally randomly and I have no idea why, either no idea how to fix it.

Here is the code:

#!/usr/bin/env python

import socket

TCP_IP = '127.0.0.1'
TCP_PORT = 7070
BUFFER_SIZE = 1024
MESSAGE = "AT\r\n"

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send(MESSAGE)
data = s.recv(BUFFER_SIZE)
s.close()

print "received data:", data
ADuval
 
Posts: 10
Joined: Fri May 18, 2018 10:07 am

Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron