Ask Experts Questions for FREE Help !
Ask
    BenAssa's Avatar
    BenAssa Posts: 21, Reputation: -1
    New Member
     
    #1

    Mar 4, 2011, 12:45 PM
    Where can I find helpful information about expiring sockets in C
    I want to make a server that accepts socket connections, but expires the connection if no information is sent.
    For this I need to either use non blocking read/select cycles or some method to expire connections
    Does anyone know where can I find more information about how to do this
    cajalat's Avatar
    cajalat Posts: 469, Reputation: 66
    Full Member
     
    #2

    Mar 5, 2011, 07:03 PM
    I'm not a C developer (well I haven't programmed in C in ages) but since you posted this to the networking section perhaps an analogy from network switches/routers can help you figure it out.

    On a network switch/router there is a similar issue with aging out ARP and CAM entries. ARP and CAM entries expire after a certain amount of time has passed and are removed from the router or switch database. They track the time passed in terms of a count down timer from the last seen packet. Whenever a packet is seen coming from a switch port the CAM entry aging timer reset. Whenever an ARP is performed on the network the ARP entry for a particular IP/MAC pair is also reset.

    Perhaps you can reset a count down timer every time you see traffic through the connection and when the timer reaches 0 you close the socket connection by issuing a FIN to both ends of the client/server connection.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Helpful information please [ 43 Answers ]

Is it possible for 2 people to fake a suicide and go into the witness protection program?

Helpful Information about Bankruptcy, Debt & Credit Bureaus [ 5 Answers ]

Below is some helpful information from our Bankruptcy & Debt Expert. Of course, you're also welcome and encouraged to post questions to this board for more information: Just click the "Ask about Bankruptcy & Debt" button at the top of the page.


View more questions Search