Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-04-2002, 09:28 AM   #1
LQ Newbie
Registered: Jun 2002
Posts: 2

Rep: Reputation: 0
how to do socket polling in kernel?


I want to let my server (a thread in kernel) to polling before it do the "accept" a connection request. That is, I want to make sure there indeed is request in the queue before I do the accept. I don't want my server to 'hang' at the accept function call.

Is there such a polling mechanism (function call even better) in socket in kernel?
Old 06-04-2002, 11:01 AM   #2
Registered: Jun 2002
Location: Grand Rapids, MI
Distribution: Redhat, Slackware
Posts: 78

Rep: Reputation: 15
I will assume that you are using TCP sockets and are talking about the accept() function that accepts connections. When you say kernel thread do you really mean that you are hacking the kernel? You could always try setting your I/O ot non-blocking on the socket FD, then poll with select.
Old 06-05-2002, 06:52 AM   #3
LQ Newbie
Registered: Jun 2002
Posts: 2

Original Poster
Rep: Reputation: 0
I'm really doing programming in kernel, a device driver actually.

Therefore I have to create a socket in kernel. And I don't see any 'select' function in 'struct socket'. There's only 'poll', and I don't know how to use it and how to fill in a parameter of its, 'poll_table_struct'.

If you really can help on this issue, I'd really appreciate it. Thank you.


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
UART Polling/Interrupt jdhar Linux - Software 1 06-10-2010 03:55 PM
Proper way of polling a device george_mercury Programming 4 12-13-2008 02:13 PM
NAPI in linux with kernel 2.6 for device polling wangjinyi Linux - Networking 0 09-22-2005 03:36 AM
Mouse polling rates Diminished7th Linux - Hardware 2 05-11-2005 07:08 PM
about device polling wangjinyi Fedora 0 04-27-2005 03:22 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:02 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