c# - Check if Socket is connected on physical machine -


preface:

i have asynchronous socket server receive telemetry data, , when remote devices not send data, have ability send commands request data. listener , command processing done on separate threads. listener listens on 1 port, while commands send on different port.

my overall question is: possible c# check if socket connected without having call "connect" method in first place? our customers device establish connection server , remain connected (unless service coverage drops or battery drains etc.). i'd avoid having keep track of connected socket objects in memory if possible.

to honest i'm not sure if i'm asking feasible. i'd hear people's thoughts.

if know socket information, invoke getextendedtcptable , state of socket ("established" or not).

for example of pinvoking function, see: http://social.msdn.microsoft.com/forums/en-us/netfxnetcom/thread/5b8eccd3-4db5-44a1-be29-534ed34a588d/


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -