c# - Why doesn't the socket close on the other side of the socket? (close_wait)? -
c# - Why doesn't the socket close on the other side of the socket? (close_wait)? - i have issue sockets. i'm creating socket between computer , phone send messages. when close server or client sends fin packet , stays in fin_wait2 state minute. however, other side stuck in close_wait state, apparently incapable of closing socket. reckon sockets should closed instantly, maybe should somehow implement code in client closes socket when server wants close , vice versa. how can that? you need close both ends of socket channel. if server closes connection client, client needs close connection on client-end, lastly fin packet transmitted (from client server). trigger lastly state transition in tcp state machine. c# c++ c sockets