tcp

Is it ok to keep TCP connections alive throughout the serving time?

Is it ok to keep TCP connections alive throughout the serving time? Question: I’m making a socket TCP server with python that handles multiple connections simultaneously. so I defined a dictionary to hold the clients socket addresses, so I could access them and traffic the information between the clients easily. but I wander if there …

Total answers: 1

What are possible causes of my python script ending prematurely?

What are possible causes of my python script ending prematurely? Question: I have a python script that communicates with other software through TCP/IP protocol. It receives data in XML format from the software. This worked fine. However, since it is part of a larger project I packed the modules and installed them into my project …

Total answers: 1

Python websockets module tutorial script does not run correctly

Python websockets module tutorial script does not run correctly Question: I am trying to mess around with the websockets module from python in order to make a simple chat server. I went to their quick start guide (found here: https://websockets.readthedocs.io/en/stable/howto/quickstart.html) and copied and pasted their server.py script and client.py script: server.py: import asyncio import websockets …

Total answers: 2

How to properly close an http connection from python requests

How to properly close an http connection from python requests Question: I saw the answers in Closing python requests connection but I don’t think the answers really specify how to close the connection, or maybe I am not really understanding what it does. For example, the following code: import requests with requests.Session() as s: s.post("https://example.com", …

Total answers: 2

youtube-dl :: how to listen to audio while downloading

youtube-dl :: how to listen to audio while downloading Question: I know that I can download an audio track from YouTube through this easy command: youtube-dl -f 251 ‘http://www.youtube.com/watch?v=HRIF4_WzU1w’ Lately YouTube has been slowing down the download speed. Is there a way I can listen to the audio while downloading the track? Where is the …

Total answers: 1

WinError 10057 – Python TCP Server is not receiving client connections from localhost

WinError 10057 – Python TCP Server is not receiving client connections from localhost Question: I have this python server code here, which is waiting to receive a message digest and an encrypted message from a python client. Clientside socket: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s=socket.socket() s.connect((HOST, PORT)) s.sendall(transmit) Server Side: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: …

Total answers: 2

Issue with writing simple TCP server in python

Issue with writing simple TCP server in python Question: I am writing a is simple TCP server using python. when i type in "localhost:12001/HelloWorld.html" into my web browser it is meant to display "Hello world" from the html file saved in my directory. When i run it, this is what is displayed in my web …

Total answers: 1

Send List of Strings from Python to C# Using TCP/socket

Send List of Strings from Python to C# Using TCP/socket Question: What is the preferred way to send a list of strings from a python server to a C# client using TCP/sockets? I’ve come across tangentially related sources but so far, nothing that specifically addresses this issue (judging by my limited background in networking). A …

Total answers: 2

unkown cause of pyModbusTCP timeout

unkown cause of pyModbusTCP timeout Question: I have a device connected via ethernet cable to the network. Its manual says it accepts modbusTCP communication protocol and indeed nmap in the configured port shows that a modbus service is open (nmap output at the end). I am no modbus expert but i found the pyModbusTCP python …

Total answers: 1

Python socket server read multi command of client

Python socket server read multi command of client Question: I created a socket server to read the commands from a socket client. In client side, I send ABC and then DEF, in server side, each time I received ABC or DEF from client, the server will send back to client OK. Server import socket import …

Total answers: 1