socketserver

Python - BaseHTTPServer.HTTPServer Concurrency & Threading

Is there a way to make BaseHTTPServer.HTTPServer be multi-threaded like SocketServer.ThreadingTCPServer? ...

Shutting down gracefully from ThreadingTCPServer

I've created a simple test app (Python 2.6.1) that runs a ThreadingTCPServer, based on the example here. If the client sends a command "bye" I want to shut down the server and exit cleanly from the application. The exit part works OK, but when I try to re-run the app, I get: socket.error: [Errno 48] Address already in use I tried th...

Python SocketServer: sending to multiple clients?

Well, I'm trying to build a small python prgram with a SocketServer that is supposed to send messages it receives to all connected clients. I'm stuck, I don't know how to store clients on the serverside, and I don't know how to send to multiple clients. Oh and, my program fails everytime more then 1 client connects, and everytime a clien...

PHP Object Orientated Socket Server

Hello! I'm creating a OOP PHP Socket server, that needs to accept multiple simultaneous client connections and reply a msg back to them if they send a certain message to the server. I have the following code: while (true){ echo "looping"; $thisClient = socket_accept($tSocket); $Clients->newClient($thisClient); $Clients...

UNIX C BSD Sockets TCP_KEEPALIVE how to check if socket is marked as broken

I have been trying to implement the TCP_KEEPALIVE parameter for a C server socket and I can't seem to figure out how to check if the socket is marked as broken. I followed this tutorial for configuring the socket to do the keep alive but it says that "If no ACK response is received for nine consecutive times, the connection is marked as...

Is Spring's ThreadPoolTaskExecutor blocking something?

We are using the ThreadPoolTaskExecutor within Spring (inside of Tomcat) to launch a concurrent server which listens on a port (3001). Our code looks a bit like: .... ServerSocket listener = new ServerSocket(port); Socket server; while (true) { PollingTask pollingTask; server = ...

Issues with implementing a network server with SocketServer

Dear Friends! I am beginner in socket programming and need your help. I have implemented simple echo server using ThreadedTCPServer example from the Python documentation. It works fine, but I have the following problems: 1) Server hangs (in socket.recv) when Client tries to send zero-length data. 2) Server hangs (in socket.recv) when th...

Python SocketServer

Hi, How can I call shutdown() in a SocketServer after receiving a certain message "exit"? As I know, the call to serve_forever() will block the server. Thanks! ...

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" at every call, why? self.server.loaded = True print self.server.loaded #...

python SocketServer.BaseRequestHandler knowing the port and use the port already opened ....

This is the code which i played, but each time i make a mistake i can't relaunch it. It says to me that the port / socket is already used That's the first question The second one is in my MyTCPHandler how can i kno the port used ? here is my code : # MetaProject v 0.2 # -*- coding: utf-8 -*- """ Thanks to : People from irc : Flox,Luyt ...