c# - Test if a port is listening without try/catch -


if i've got tcp port on "server" app listening within few seconds (i.e. launch client , server apps @ same time), know on client app can (simplistically)

tcpclient connect() {   try {     return new tcpclient("127.0.0.1", 30276);   } catch {     connect();   } } 

is there way without throwing exceptions though? it's inconvenient have these in logs , stopping debugger time, , feels there should better way this.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -