Sponsored Content
Full Discussion: Problems with select
Top Forums Programming Problems with select Post 302393855 by Corona688 on Tuesday 9th of February 2010 11:36:45 PM
Old 02-10-2010
Problems with select

Is select only supposed to report state changes on an FD's, state, whether or not it had pending input available in the first place? I've got a situation where select() repeatedly reports no FD's ready for stdin when there's lots of data available. And if it only reports changes, how is this useful? It's impossible to guarantee an FD has no pending data before you call select(), making its return value meaningless at worst and at best a crapshoot.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

'make' problems (compliation problems?)

I'm trying to compile and install both most recent version of 'make' and the most recent version of 'openssh' on my Sparc20. I've run into the following problems... and I don't know what they mean. Can someone please help me resolve these issues? I'm using the 'make' version that was... (5 Replies)
Discussion started by: xyyz
5 Replies

2. Programming

Problems with pipe(...); using select(...);

Hello all, My problem is as follows: I'm trying to wake up a select(...); using a pipe fd. This should be rather straightforward, but I cannot get it to work. Perhaps you guys could give me a few tips. My wakeup function looks like this: STATIC void net_trig_wr() { /* write a dummy... (0 Replies)
Discussion started by: ne2000
0 Replies

3. Programming

select function

Dear all, I am using select function for the socket programming. What is the purpose of except fd's fd set in the argument. (0 Replies)
Discussion started by: nagalenoj
0 Replies

4. Shell Programming and Scripting

select a column

I've a file like this: andrea andre@lol.com october antonio@lol.com marco 45247@pop.com kk@pop.com may pollo@lol.com mary mary@lol.com can I select only the column with email adress? can I utilise a filter with @ ? I want obtain this: ... (2 Replies)
Discussion started by: alfreale
2 Replies

5. Shell Programming and Scripting

select a particular field

hi i have a file wwww-qqq.eee ksdklfsdf adm,as.d,am sdsdlasdjl sadsadasda wwww-qqq.eee ksdklfsdf adm,as.d,am sdsdlasdjl sadsadasda wwww-qqq.eee ksdklfsdf adm,as.d,am sdsdlasdjl sadsadasda wwww-qqq.eee ksdklfsdf adm,as.d,am sdsdlasdjl sadsadasda wwww-qqq.eee ksdklfsdf adm,as.d,am... (4 Replies)
Discussion started by: Satyak
4 Replies

6. Shell Programming and Scripting

Select Script

Dear Members:- i want to make this script 1- i have a log directory /export/home/roxy/log 2- file name in this directory with this format filename_DD_MM_YYYY_%H%M%S.log i want to make script for example: # script.sh _09_04_2009_ _10_04_2009_ this script make select to log file into... (4 Replies)
Discussion started by: dellroxy
4 Replies

7. Shell Programming and Scripting

using the output of select

hi, i need to use the output of select query. the output i get using "X=`sqlplus -s $var1/$var1<<eof select port from table1;` echo $X " is "port ----- 2000" now i want to use only 2000 in my next command. hw do i do it? (4 Replies)
Discussion started by: deep_bree
4 Replies

8. Boot Loaders

Reboot and Select Proper Boot device or insert Boot media in select Boot device and press a key

Hello, I have kubuntu on my laptop and now I decided to switch to Windows 7. I made the bios settings properly (first choice is boot from cd\vd) but I see the error " reboot and select proper Boot device or insert Boot media in select Boot device and press a key " I have tried CD and... (0 Replies)
Discussion started by: rpf
0 Replies

9. Windows & DOS: Issues & Discussions

Need help in select statetment

Dear Expert, I have an table name (SMS) in which two column are there one "Flag" other is "Message", If my flag column consist of status "1" then output should be "welcome", else" try again" ,. please correct my code. DECLARE c PLS_INTEGER := dbms_sql.open_cursor; flag VARCHAR2(50); ... (1 Reply)
Discussion started by: Alone
1 Replies

10. UNIX for Beginners Questions & Answers

Select command

Hi I'm using the "select" command in the global_env.sh to log in to the application directory. This file is called in .bashrc profile. Sample code: Filename: global_env.sh set -o vi export severname=$(uname -n) printf '%s\n%30s\n%s\n' "***********************" "Welcome to $severname"... (6 Replies)
Discussion started by: cheers799
6 Replies
IO::Select(3pm) 					 Perl Programmers Reference Guide					   IO::Select(3pm)

NAME
IO::Select - OO interface to the select system call SYNOPSIS
use IO::Select; $s = IO::Select->new(); $s->add(*STDIN); $s->add($some_handle); @ready = $s->can_read($timeout); @ready = IO::Select->new(@handles)->can_read(0); DESCRIPTION
The "IO::Select" package implements an object approach to the system "select" function call. It allows the user to see what IO handles, see IO::Handle, are ready for reading, writing or have an exception pending. CONSTRUCTOR
new ( [ HANDLES ] ) The constructor creates a new object and optionally initialises it with a set of handles. METHODS
add ( HANDLES ) Add the list of handles to the "IO::Select" object. It is these values that will be returned when an event occurs. "IO::Select" keeps these values in a cache which is indexed by the "fileno" of the handle, so if more than one handle with the same "fileno" is specified then only the last one is cached. Each handle can be an "IO::Handle" object, an integer or an array reference where the first element is an "IO::Handle" or an integer. remove ( HANDLES ) Remove all the given handles from the object. This method also works by the "fileno" of the handles. So the exact handles that were added need not be passed, just handles that have an equivalent "fileno" exists ( HANDLE ) Returns a true value (actually the handle itself) if it is present. Returns undef otherwise. handles Return an array of all registered handles. can_read ( [ TIMEOUT ] ) Return an array of handles that are ready for reading. "TIMEOUT" is the maximum amount of time to wait before returning an empty list, in seconds, possibly fractional. If "TIMEOUT" is not given and any handles are registered then the call will block. can_write ( [ TIMEOUT ] ) Same as "can_read" except check for handles that can be written to. has_exception ( [ TIMEOUT ] ) Same as "can_read" except check for handles that have an exception condition, for example pending out-of-band data. count () Returns the number of handles that the object will check for when one of the "can_" methods is called or the object is passed to the "select" static method. bits() Return the bit string suitable as argument to the core select() call. select ( READ, WRITE, EXCEPTION [, TIMEOUT ] ) "select" is a static method, that is you call it with the package name like "new". "READ", "WRITE" and "EXCEPTION" are either "undef" or "IO::Select" objects. "TIMEOUT" is optional and has the same effect as for the core select call. The result will be an array of 3 elements, each a reference to an array which will hold the handles that are ready for reading, writing and have exceptions respectively. Upon error an empty list is returned. EXAMPLE
Here is a short example which shows how "IO::Select" could be used to write a server which communicates with several sockets while also listening for more connections on a listen socket use IO::Select; use IO::Socket; $lsn = IO::Socket::INET->new(Listen => 1, LocalPort => 8080); $sel = IO::Select->new( $lsn ); while(@ready = $sel->can_read) { foreach $fh (@ready) { if($fh == $lsn) { # Create a new socket $new = $lsn->accept; $sel->add($new); } else { # Process socket # Maybe we have finished with the socket $sel->remove($fh); $fh->close; } } } AUTHOR
Graham Barr. Currently maintained by the Perl Porters. Please report all bugs to <perlbug@perl.org>. COPYRIGHT
Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-01-06 IO::Select(3pm)
All times are GMT -4. The time now is 06:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy