Follow

Playing with TCP for the first time ever. Using the socket module in . I was really thrown for a loop when the socket automatically closed while trying to make sure I read the whole response.

In order to support multiple requests in a script I'm having to initialize a new socket for each request. This feels like I am doing something wrong, but with arbitrary length returns, no hint to response length, and no end character I'm not sure what else to do.

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml