LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


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

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


Hi.

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, 10:01 AM   #2
kahuna
Member
 
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, 05:52 AM   #3
lylai
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.
 
  


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:32 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration