Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-08-2011, 01:41 PM   #1
LQ Newbie
Registered: Mar 2011
Posts: 5

Rep: Reputation: 0
timer in socket programming

Hello ,
I have a server listening on incoming client connections. Once the client establishes SSL connection with the server , the server waits on read() from the client. Only Client can disconnect the connection. I want to have a timer in the server program to wait for x secs after read() and then disconnect the Client connection.
Any pointers which timer library to use or how to achieve this,
Old 03-09-2011, 01:41 AM   #2
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
I am aware of a program known as caliberate.c in kernel look for it.This has some useful tricks which help to work from scratch.What you can search is delay loop calculation in caliberate.c
0 members found this post helpful.
Old 03-09-2011, 01:48 PM   #3
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
the select() call can be used to test multiple file descriptors for available data to read, and comes with a timeout parameter. I think it is intended to solve the particular problem you describe.

--- rod.
1 members found this post helpful.
Old 03-10-2011, 11:59 AM   #4
LQ Newbie
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: 0


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anybody know about configuring socket timer to release socket linjoy Linux - Networking 1 06-19-2010 04:43 AM
HPET timer programming in C sarans1987 Linux - Software 3 09-08-2009 10:38 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration