Questions tagged [python-sockets]
For questions related to the sockets module in the Python standard library, or more broadly socket programming in Python.
python-sockets
511
questions
0
votes
1
answer
18
views
Socket connection fails(ESP8266) [closed]
I'm connected to ESP-WROOM device from a PC on Windows 11. I'm trying to connect a socket in MicroPython to a server on my LAN.
I simplified my code to the following to show the error I keep getting.
...
0
votes
0
answers
8
views
How to transfer image files wirelessly between two PCs at different networks using sockets in python?
I have been trying to send files between two PCs using sockets.
Computer A(Sending end):
import socket
from PIL import Image
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(('ip_address'...
-2
votes
0
answers
38
views
ssl: server does not recognize client's ca.crt
I have a problem with the server asking me to check the client's CA certificate.
The client has the task of checking the server certificate ca.
These are the same certificates, but an error occurs ...
0
votes
0
answers
29
views
How to secure a MySQL Connection in Python [duplicate]
I want to connect to my SQL database from my Python application without leaking my credentials.
Through research and other threads, I have found the most common method to be use either a config file ...
0
votes
0
answers
11
views
RPI-Python-Sockets: socket still see packets after network stream ends. Do they get buffered?
my application requires me to detect multicast streams and react to them. Defining the sockets and igmp is fine but once the stream(s) ends , the select seems to stay active for 60 seconds.
...
0
votes
0
answers
131
views
MacOS: AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'
I kept getting this error:
AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'
I tried to follow solutions from this stackoverflow question, however still getting the same error.
If I ...
0
votes
1
answer
21
views
Python UDP server continues processing messages after KeyboardInterrupt, leading to "Bad file descriptor" error
I have implemented a UDP server in Python using threading to handle message reception and processing. The server is intended to stop gracefully when a KeyboardInterrupt (Ctrl+C) is caught. However, ...
0
votes
1
answer
108
views
Wrapping and integrating an existing Python `socket`-based class with `asyncio`
I have a use-case where there are a lot of TCP/IP clients being bundled up into a single Python process. The current desire is to use asyncio to provide concurrency for the program. For all new TCP/IP ...
0
votes
1
answer
43
views
Python UDP socket not sending all packets, or not all packets are received on the other end
I'm working on an implementation of a logical data diode, which means that data can only flow in one direction. No ACKs are allowed. Therefore, I have chosen UDP. This is the gist of the protocol:
...
-1
votes
1
answer
56
views
Too fast checking local ports with python socket
This code example is given in the book "CPython Internals".
from queue import Queue
import socket
import time
timeout = 1.0
def check_port(host: str, port: int, results: Queue):
sock = ...
0
votes
0
answers
34
views
Python Socket Programming: 'Bad file descriptor' Error with Multiple Client Instances
I'm working on a simple chat application using Python's socket programming and RSA encryption for secure communication. The application consists of two scripts: client.py and server.py. The server ...
0
votes
0
answers
38
views
Python socket get stuck when printing
program 1:
print(client_socket.recv(1024).decode('utf-8))
program 2:
response=client_socket.recv(1024).decode('utf-8')
print(response)
# rest of the code
program 1 works fine but program 2 is ...
0
votes
1
answer
48
views
Python console application can't make a link using colorama
tools.py Linked function:
from colorama import Fore, Style
def Linked(url, text=None):
if text is None:
text = url
print(f"{Fore.BLUE}{Style.BRIGHT}{text}{Style.RESET_ALL} ({Fore....
0
votes
1
answer
275
views
The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
I am using Flask and SocketIO.
I am getting
The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO) on my ...
0
votes
0
answers
49
views
Open socket server with ssh
I can open a remote socket server to run in background with this terminal command:
ssh -p22 [email protected] nohup python3 /home/pi/scripts/sock_serv.py &
I want to open the server from the ...