Questions tagged [socketserver]

Python module which simplifies the task of writing network servers.

385 questions
1
vote
1 answer

How can I get a client's Name attribute with SocketServer in python?

I'm using a class RequestHandler(SocketServer.BaseRequestHandler)to handle incoming connections to a server. I am trying to get the name of the client which is stored as an attribute that sends data to this server, but right now I can only get it by…
Nik SG
  • 90
  • 8
1
vote
1 answer

How to rise max rate on socketserver of Python3?

Im working at Python3 DNS server, and i ran into a problem with max queries per second using socketserver module. There is statistic for classic Bind9 server: DNS Performance Testing Tool Version 2.11.2 [Status] Command line:…
RockBash
  • 11
  • 2
1
vote
0 answers

TCP Socket Servers

Is even possible to start multiple TCP socket server using an list? Maybe a sample would be more useful class MyHttpRequestHandler(http.server.SimpleHTTPRequestHandler): #This is my handler. It works great for one server so not including it to…
1
vote
1 answer

how to know whether the remote end closed the socket using send system call?

the send() system call succeeds for the first time even if the remote end closed the connection. If i send again, then sigpipe will be generated. I don't want to use recv system call to know whether remote end closed the connection. So can someone…
abc
  • 11
  • 1
1
vote
1 answer

Socket.io Cross-Origin Resource Sharing Issue

We have our socket server hosted on AWS and it is connected with 4 URLs. The code base hasn't been changed for like 9 months but recently I'm getting an error. The error: Access to XMLHttpRequest at 'https:something' from origin 'https://something'…
shash
  • 45
  • 5
1
vote
0 answers

TCP Socket Server send message

I am trying to implement a threaded TCP server using socketserver as documented here. https://docs.python.org/3/library/socketserver.html#socketserver-tcpserver-example I am trying to get it to connect to other servers and send messages, but I can't…
weasel
  • 534
  • 1
  • 5
  • 18
1
vote
0 answers

Using DTLS with socketserver (ThreadedUDPServer)

I am very new to network programming so please bear with me if I make newbie mistakes. I have written a networking engine using ThreadedUDPServer from Python's socketserver library, which add layers of reliability to a certain level (UDP because…
1
vote
0 answers

Run http.server in background (python, not bash)?

I need to start a server on localhost:3000 when starting python TestCase and then close it after TestCase finished. I just realized that http.server does not detach the server so after starting the server, the TestCase does not continue until the…
Milano
  • 18,048
  • 37
  • 153
  • 353
1
vote
1 answer

What is the best way to manage db connection in a preforking daemon

I am pretty new to python and am using pythons SocketServer.ForkingTCPServer to create a network script that needs to connect to a database(mysql). I expect the program to get hit at around 30 - 40 times a second. Is it possible to share the same…
Jesse
  • 345
  • 1
  • 4
  • 6
1
vote
1 answer

How can I fix the weird characters I receive from my websocket

I am trying to connect a website to my java plugin (in minecraft) and let them communicate and play audio. When I try to send a connected message I receive weird characters, how can I fix this?? ���}+��X������R�} Websocket code: var ws = new…
Justin
  • 39
  • 1
  • 5
1
vote
0 answers

PHP websocket server stop at more than 50~60 user

I have simple php web socket for my chatroom it works nice for low users , less than 50 , but no CPU usage no memory usage used but it's stop working after that when users go up and up .. We ran it on Ubunto :
dev moore
  • 75
  • 8
1
vote
1 answer

Remote client and server communication using TCP sockets in c++

I want to run server and clients using socket programming remotely (clients from my pc and server on a remote host). I have written a program in C++ that runs on local machine, both the client and the server. Now how can I run the server from a…
user14448603
1
vote
0 answers

How to transfer media stream from SocketSever to Falcon API with Python

I am developping a small python server that aims to receive a MP4 stream as a socket server and I want to transfer the data to another client that connect with a GET request with Falcon. Here my API server that send the media: class StreamResource: …
elpha01
  • 196
  • 2
  • 4
  • 19
1
vote
0 answers

How can I read the message I send with the pickle.dump method in C # as a string?

I have socket server between python and C#. (Python server - C# client) I want to send nested array to C# client with pickle.dump from python server. But when I try to read message with C# client I get a meaningless string. It like…
brkcnbaz
  • 27
  • 7
1
vote
0 answers

How to set a timer to stop camera streaming through SocketServer on Raspberry Pi?

I'm trying to stream webcam on Raspberry Pi. I found this code on picamera official documentation. The script uses Python’s built-in http.server module to make a simple video streaming server, which works fine for me: import io import…