#Server Socket Acting weird

13 messages · Page 1 of 1 (latest)

zinc flame
#

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?

fierce furnace
#

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.

zinc flame
#

thats weird its working perfectly fine for me?

fierce furnace
#

Just "Server Starting" im not sure what that is... no erros no nothing... after a while it fails and just exits

zinc flame
#

huh thats weird have you tried connecting with putty and seeing if it works on your end

gusty geyser
#

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

zinc flame
#

im using putty to connect and test the server

gusty geyser
#

it's possible that putty is opening more than one connection. maybe add a log to verify

latent solstice
#

and sshot of what you’re doing/seeing

zinc flame
#

yes ill be able to get a video soon