Questions tagged [socketserver]

Python module which simplifies the task of writing network servers.

385 questions
0
votes
1 answer

How to accept all data from connection in socketserver python?

How to receive all data from a connection in socketserver so that it the connection does not hang on the client side class ConnectionHandler(BaseRequestHandler): def handle(self): data = b'' while 1: tmp = …
loaded_dypper
  • 262
  • 3
  • 12
0
votes
0 answers

When trying to run local server on command prompt an error occurred

I am trying to run my local server for my website in Django but I can’t because I see the following errors ` Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File…
0
votes
1 answer

Why is the client program not running when the localHost IP address is not used?

I am writing a Bulletin Board as a client server program using socket programming. The server side code is as follows: import time from socketserver import * from socketserver import BaseRequestHandler, TCPServer SENDING_COOLDOWN = 0.3 BUFFER_SIZE =…
0
votes
1 answer

How can I host the folder's content for anyone to access and have my device act as a server while it's running?

I'm trying to share a folder for anyone to access while running the code by making my local machine act as a server PORT = 8000 DIRECTORY = "/content/sample_data" class Handler(http.server.SimpleHTTPRequestHandler): def __init__(self, *args,…
Myelin
  • 3
  • 1
0
votes
1 answer

How to parse CRLF response from tcp client using socketserver?

I am writing a TCP server using python and socketserver and using threads. TCP server should send commands to device and read the response from the device. The device sends a initial message to server after connection and following commands are sent…
Preeti
  • 535
  • 1
  • 6
  • 30
0
votes
2 answers

Python socketserver.BaseRequestHandler must raise an event on file received

Being a newbie in python and server programming, I am trying to wrap my head around the socketserver and it's threading mixin. So far i have created a working server that handles ping-requests and can receive multiple files - one file per…
Raveno
  • 71
  • 2
0
votes
0 answers

Django AppRegistryNotReady when running another multiprocessing.Process

Problem I needed to run multiple UDP servers on different ports that exchange data with a Django core, so I defined a Django command which calls a method (start_udp_core) that runs each UDP server in a separate process. I used socketserver.UDPServer…
Rooz
  • 21
  • 3
0
votes
0 answers

AWS MSK - Internal Brokers communication

I am using AWS MSK for our production workload and we have been noticing some not very clear log messages in cloudwatch. The messages are about the internal communication between brokers (more on cluster setup later): [2022-05-14 06:50:17,171] INFO…
AlessioG
  • 576
  • 5
  • 13
  • 32
0
votes
0 answers

Cannot connect to multi-threaded TCP server

I'm trying to setup a threaded server where multiple clients can connect at the same time. This is a bit long, please do bear with me. I've already read this helpful realpython article on sockets as well as the socket and socketserver docs. Python…
Nathan Furnal
  • 2,236
  • 3
  • 12
  • 25
0
votes
1 answer

How to modify handle method in socketserver

I am learning the socketserver module and I am following the example but I modified the handle function a bit class CustomServer(socketserver.BaseRequestHandler): def handle(self): self.data = self.request.recv(1024).strip() …
epic_rain
  • 1
  • 3
0
votes
1 answer

How to open a TCP socket to listen for one connection and return result?

I'm trying to write a script which opens a port, (pokes a third party), then captures and returns the interesting part of their http request for my main thread to continue with. The third party thinks we are an http webserver. TCPServer.SocketServer…
John Mee
  • 50,179
  • 34
  • 152
  • 186
0
votes
0 answers

Unsupported or unrecognized SSL message, cannot be read

I am trying to display the date on an HTTPS website via an SSL server. I am getting an error thrown on line 31 (I have marked where it is). I reckon it might be to do with the browser and how it is set up. Since the error is coming from an…
Ben
  • 9
  • 1
  • 3
0
votes
0 answers

Is better way to send list of data Soket TCP C#

i have a list of data and i want send it to clients. This is the way i choosed: private static void StartServer() { _server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _server.Bind(new…
Mahdi
  • 23
  • 9
0
votes
1 answer

ThreadedTCPServer works unless client is a separate process

I adapted the code below from the Python documentation here. # filename: example.py from datetime import datetime import socket import socketserver import sys import threading import time class…
Alex Shroyer
  • 3,499
  • 2
  • 28
  • 54
0
votes
0 answers

Python date.today() not refreshing

I have a small-scale python server to handle some incoming requests over the network. class MyTCPHandler(socketserver.BaseRequestHandler): def handle(self): current_date = date.today() formatted_date =…