The server listens for client connections on a specific port and prompts the client for a username.
After receiving the username, it checks whether the username is "fart" and prints "Correct" if so.
The username prompt should only appear once each time a client is asked for their username.
However, after the first attempt, the prompt appears twice but still functions how its supposed to how do i fix the double prompt?
#Server Socket Acting weird
13 messages · Page 1 of 1 (latest)
I copied the code and was going to attempt to debug with vscode but it won't even get past "Server Starting" for some reason.
thats weird its working perfectly fine for me?
what exactly does it say ?
Just "Server Starting" im not sure what that is... no erros no nothing... after a while it fails and just exits
huh thats weird have you tried connecting with putty and seeing if it works on your end
how are you testing it?
if you're opening more than one connection, you'll get the "Username " prompt once
using netcat, it seems to work as expected
nc localhost 3568
Username: test
Username:
@fierce furnace while waiting for a connection, "Server Starting " will be the only server log unless there is an error. you'll need to open a TCP connection with netcat or some other client to see the prompt
im using putty to connect and test the server
it's possible that putty is opening more than one connection. maybe add a log to verify
and sshot of what you’re doing/seeing
yes ill be able to get a video soon