515 questions
0
votes
0
answers
40
views
Is there a way to run two servers at the same time independently?
I want to make flask app that displays data that the socket server recieves from other client is
Is there a way to run this code:
import socket
def server():
host = socket.gethostname()
port =...
0
votes
1
answer
72
views
"socket" has no attribute "accept"
Why is mypy complaining?
"socket" has no attribute "accept" [attr-defined]
import socket
def a() -> socket.SocketType:
...
b = a()
c, _ = b.accept()
It seems like the ...
2
votes
2
answers
99
views
Python Socket Communication Breaks When Removing print Statement
I send multi line python string with socket:
elif command=="help":
help_options='''
download <path> -> Download a File from Target Machine
upload &...
0
votes
1
answer
85
views
UnicodeDecodeError with socket.getfqdn in Django runserver on Windows
I’m building a Django API. After transferring my project to a new server and attempting to run it with:
python manage.py runserver
I encountered the following exception:
File "", line 795, ...
-1
votes
1
answer
43
views
pygame multiplayer jsondecodeerror
I'm developing a two-player multiplayer game with pygame.
Here is the server code and client code:
<Server Code>
import json
import pygame # Main module for the game
import pyautogui # For ...
1
vote
0
answers
69
views
Connection timeout using the sock_connect method of the asyncio library
When I use the connect method of the socks library directly, the connection is successful, but when I replace it with the sock_connect method of the asynic library, the connection times out.
import ...
1
vote
0
answers
47
views
Difference in behaviour of socketbinding betwen Linux and Windows in Python
I'm making a python lib that I want to be able to use in both Linux and Windows. But I'm experiencing issues when I'm trying to bind a socket to listen to a broadcast. It seems like on linux I need to ...
0
votes
1
answer
44
views
Python, socket, freezing the console before departure
I have two codes server and client. When sending an image from the client to the server, everything goes fine, but later I want to send a message to the client from the server and before sending it, ...
2
votes
1
answer
2k
views
Can't connect to server through pinggy tcp ssh tunnel
I am trying to setup TCP communication between a client and a server in different networks.
Since I do not own a public server and don't want to setup port forwarding, an option was to use TCP ...
1
vote
2
answers
66
views
Are there any strategies around editing dictionaries nested in shared dictionaries?
I'm trying to edit a dictionary inside a shared dictionary in separate processes but they're immutable. Are there any techniques that I might be missing on how to get around this?
Here's an example
...
0
votes
1
answer
93
views
How do I create a socket connection from Macbook M1 to raspberry pi on my local network
I am new to socket coding. I just want to send messages from client to server across my local network.
I have a Macbook M1 and a Pi4. I put this socket client on the MacBook and give it the IP of the ...
0
votes
0
answers
65
views
Extra 0x00 at the start of TLS Client Hello packet, how to remove it?
I'm working on a Python proxy server that needs to receive TLS Client Hello data from a browser and forward it to the target server. However, I've noticed that the Client Hello packet sent by my proxy ...
1
vote
2
answers
453
views
What is the type hint for socket?
Suppose I'm writing a function that takes a socket as a parameter. How should I type hint it properly?
def read_socket(socket: ???):
....
0
votes
1
answer
110
views
My python chat server does not send messages properly
When sending a message for the send time from the client it is not sent to the other client.
I'm fairly new to Python and sockets. some of the commented off code has been code I've tried but has not ...
1
vote
0
answers
476
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 ...