LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 03-08-2011, 12:41 PM   #1
rrockz
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,
Thanks,
 
Old 03-09-2011, 12:41 AM   #2
tkmsr
Member
 
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, 12:48 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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, 10:59 AM   #4
rrockz
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks!
 
  


Reply


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 03:43 AM
HPET timer programming in C sarans1987 Linux - Software 3 09-08-2009 09:38 AM


All times are GMT -5. The time now is 01:42 AM.

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