Skip to content

Tag: sockets

Send in-memory bytes (file) over multipart/form-data POST request. Python

;TLDR I want to send a file with requests.send() using multipart/form-data request without storing the file on a hard drive. Basically, I’m looking for an alternative for open() function for bytes object Hello, I’m currently trying to send multipart/form-data request and pass in-memory files in it, but I can’t figure out how to do that. My app receives images from

Connection reset by peer error showing despite using try

I have a server like this: but the error of ConnectionResetError: [Errno 104] Connection reset by peer still occurs on client disconnection, shouldn’t the error be handled by try except ? If not how else do I handle this error without the script being terminated? Answer From this answer I found the following solution: but I recommend reading the comment

How to use the options to socket() for IPv6 multicast UDP?

I have a linux network interface that IPv6 multicast traffic is arriving on. There are both ICMPv6 packets and UDP packets arriving for the same multicast group. I’m trying to receive the UDP traffic. The code below is in Python but I don’t believe this is important; the Python library here is a pretty thin wrapper around the BSD sockets

How to send and receive data the same time Python UDP socket

I just learned about #python recently, I have done a small project about rasberry pi. I want to transmit and receive data between Server is Laptop, client is Ras via UDP protocol, I use Python’s socket library. Transmit sensor data from ras to laptop, and transmit control commands from laptop to ras. Data from ras must always be transmitted, so

I can’t get a response from the server via socket python

I’m trying to send a string to the server, but I can’t send the data and get a response, what’s the problem, please help. When I connect to the server via netcat, everything is fine. Answer I was finally able to get a response from the server, it was because NetCat automatically adds n when sending text and the command