Python module which simplifies the task of writing network servers.
Questions tagged [socketserver]
385 questions
3
votes
1 answer
broken pipe error with python multiprocessing and socketserver
Essentially Im using the socketserver python library to try and handle communications from a central server to multiple raspberry pi4 and esp32 peripherals. Currently i have the socketserver running serve_forever, then the request handler calls a…

kadytoast
- 33
- 4
3
votes
2 answers
Python SocketServer error upon connection
I am running a Python server using the socketserver module in Python 3.1. Every time I get a connection from the client (which succeeds client side), my server receives an error. Here is my code:
import socket
import socketserver
import…

pajm
- 1,788
- 6
- 24
- 30
3
votes
0 answers
Proper way to close socketserver client sockets
Would like to know if explicit action has to be taken in order to close communication sockets used by the socketserver module. I know that server_close() method exists, but as far as I'm aware, it's only meant for the master server socket. Regarding…

das
- 41
- 2
3
votes
1 answer
How to send and receive webcam stream using tcp sockets in Python?
I am trying to recreate this project. What I have is a server (my computer), and a client (my raspberry pi). What I am doing differently than the original project is that I am trying to use a simple webcam instead of a raspberry pi camera to stream…

InfinityBit
- 47
- 2
- 6
3
votes
1 answer
How to stop TCPServer
On every of three iterations TCPServer needs to be started and then immediately stopped. All three times it needs to be started on port 8000.
As it defined in a code below, the TCPServer starts. But it starts only during the first iteration. Two…

alphanumeric
- 17,967
- 64
- 244
- 392
3
votes
2 answers
Asynchronous Socket Server in C#, client to client communication through socket server
I am trying to develop server/client Asynchronous sockets using c#. I have followed guide on MSDN Link. In my case, socket server listening on particular endpoint, many clients can connect to server at a time, clients can talk to server and server…

Kashif Ali
- 35
- 1
- 1
- 7
3
votes
0 answers
Can NodeJS function app.listen() Choose site IP?
I have a Windows Server host with two network cards:
192.168.1.205 and 192.168.1.206;
192.168.1.205 Running IIS and using 80 port and 443 port which is working fine,
I expect 192.168.1.206 used as node js webSocketServer,
And only use 192.168.1.206…

BlueOops
- 61
- 2
3
votes
2 answers
How do I modify variables in the SocketServer server instance from within a RequestHandler handler instance in Python?
Here's the code in question:
class Server(SocketServer.ForkingMixIn, SocketServer.TCPServer):
__slots__ = ("loaded")
class Handler(SocketServer.StreamRequestHandler):
def handle(self):
print self.server.loaded # Prints "False"…

Mikhil Masli
- 97
- 8
3
votes
1 answer
C - epoll reports EPOLLIN indefinitely for 1-way closed socket
I'm implementing an HTTP server using epoll in C. The server parses the request and responds accordingly.
Everything works when I issue simple curl requests (ie. no concurrency).
However when using concurrent clients and issue multiple requests,…

Agis
- 32,639
- 3
- 73
- 81
3
votes
0 answers
File download android server
It has been days I am struggling with this problem. I want to create a local android server to let other devices download a file in LAN. So far i have created a socket server that writes a pdf file along with header on output stream, but it is not…

Sachin Chandil
- 17,133
- 8
- 47
- 65
3
votes
1 answer
Uncaught type error: Cannot read property of 'send' undefined
I am trying to send a message to my websocket in the form of json but I got this error in the developer console when I run the web app. I know this error occurs when the element could not be found. However, isn't 'send' a default member of…

Lew Wei Hao
- 763
- 1
- 13
- 25
3
votes
2 answers
Why only 1024 bytes are read in socketserver example
I am reading through the documentation examples for python socketserver at https://docs.python.org/2/library/socketserver.html
Why is the size specified as 1024 in the line self.request.recv(1024) inside handle method. What happens if the data sent…

Bunny Rabbit
- 8,213
- 16
- 66
- 106
3
votes
1 answer
Calling sock.recv() after sock.sendall() in Python
I provided a WORKING client and server file.
The client sends a picture to the server.
When you comment out:
data = sock.recv(1024)
print("received: ",str(data,"UTF-8"))
the picture will not be uploaded to the server anymore...
(After receiving the…

vampierke33
- 31
- 1
- 4
3
votes
1 answer
Python simple HTTPS forwarder
Below is the simple script I'm using to redirect regular HTTP requests on port 8080, it redirects(causes them to be at least) them depending on the source IP address right away.
It works (for HTTP), however I would like to have the same behavior for…

Kerem
- 2,867
- 24
- 35
3
votes
1 answer
SocketServer never exits
I'm starting a simple TCP server using SocketServer:
class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
pass
...
server = ThreadedTCPServer((HOST, PORT), ThreadedTCPRequestHandler)
server_thread =…

Amir Gonnen
- 3,525
- 4
- 32
- 61