UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » Networking
  • » Socket (connected) File Descriptor after TCP Connection RESET !!!

#1 2014-04-25 07:54 AM

KewlGuy1
Member
From: Hyderabad
Registered: 2012-07-11
Posts: 8

Socket (connected) File Descriptor after TCP Connection RESET !!!

Trying to develop a concurrent TCP Server with only select() system call.Let us say if the connected client reset the already Established connection; how the application can know it in better way and delete (CLEAR) the corresponding socket fd from the list of FD_SET ? If the TCP State machine move from ESTABLISHED to TIME_WAIT state; still the connection holds for that TIME_WAIT interval (default 60 seconds) and later connection will be removed by Linux Kernel. If the connection itself was removed ; what about the corresponding file descriptor ?? was it removed by Kernel instantly??

Offline

#2 2014-04-25 12:06 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: Socket (connected) File Descriptor after TCP Connection RESET !!!

Offline

#3 2014-04-29 11:27 AM

KewlGuy1
Member
From: Hyderabad
Registered: 2012-07-11
Posts: 8

Re: Socket (connected) File Descriptor after TCP Connection RESET !!!

Thanks for the detailed response. Able to solve the issue by having an if condition (<=0) for return value of "recv" function. Later., FD_CLR, close(socket fd) did the job.

Offline

  • Index
  • » Networking
  • » Socket (connected) File Descriptor after TCP Connection RESET !!!

Board footer

Powered by FluxBB