C# - Network Programming - Verify client before allowing connection -


i'm new network programming stackoverflow, hope won't make bad mistakes.

i try code client/server application using tcplistener/tcpclient. don't want accept every client trying connect server.

i don't understand if 2 parties stay connected when client doesn't send request, , how possible verify client using password or something. how this?

i don't expect tutorial maybe link reference or youtube tutorial, couldn't find helpful things on research.

thank you, fre3zr

the tcp protocol works following: or accept connection or don't. after accepting, can checks , reject client, if want.

pseudo-code:

sock1.accept()  if data     store received data in "x"     if password match "x" continue, if not: kickclient() end if 

and yes, client keeps connected when finished sending data, must disconnect him in order free resources.

add code question, more.


Comments

Popular posts from this blog

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

android - Linear layout children not scrolling -

javascript - Create websocket without connecting -