Questions about sockets and checking for recieved data

Well, if you don’t add a newline to the data you send then receive("*l") will never finish since you’re using blocking sockets without a timeout. “*a” will read until you close the socket, and that’s probably not what you want.

1 Like

yeah I tried the “*a” it still didn’t fix it. I’m going to check back on my server and make sure I didn’t miss something.

If you’re never closing the socket then “*a” will block the execution indefinitely while constantly reading data. You will never be able to read any of it.

I still don’t really understand what you’re doing. Are you using the socket to do user authentication only? How does your server know that it is a username and password you’re sending? And how does it know when to stop reading the data you’re sending? You’re not using any message buffer system or anything where you are differentiating between different messages both when sending and receiving data.

It feels like you’re trying to do fairly complicated socket communication without enough knowledge of how such things are typically done.