07-10-2001
Select is asynchronous, whereas you listen on a socket and when inbound information comes in,the process that is in select mode accepts the data.
Polling would require the process to actively initiate the action to go 'get the data'.
This is a very different method and is not simple matter of converting select (the system call) to another function. You must restructure the algorithm.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks,
As we all know, the "select" function give a number to each element as the number of elements in the select.
for example:
I have a program which ask a user to select a language:
===============================================================================
Please select the... (1 Reply)
Discussion started by: nir_s
1 Replies
2. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
3. HP-UX
Hi people!
I've got this own library:
--------------------------------------------
Personal.h
--------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdarg.h>
#include <string.h> ... (0 Replies)
Discussion started by: donatoll
0 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. Shell Programming and Scripting
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Discussion started by: timmywong
8 Replies
6. Solaris
The system don't boot.
on the screen appears following:
press enter to maintenance (or type CTRL-D to continue)...I checked with format command.
... the slices "0-root","1-swap","2-backup" exist.
...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
9. AIX
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT OPENSOLARIS
listen
listen(3XNET) X/Open Networking Services Library Functions listen(3XNET)
NAME
listen - listen for socket connections and limit the queue of incoming connections
SYNOPSIS
cc [ flag ... ] file ... -lxnet [ library ... ]
#include <sys/socket.h>
int listen(int socket, int backlog);
DESCRIPTION
The listen() function marks a connection-mode socket, specified by the socket argument, as accepting connections, and limits the number of
outstanding connections in the socket's listen queue to the value specified by the backlog argument.
If listen() is called with a backlog argument value that is less than 0, the function sets the length of the socket's listen queue to 0.
The implementation may include incomplete connections in the queue subject to the queue limit. The implementation may also increase the
specified queue limit internally if it includes such incomplete connections in the queue subject to this limit.
Implementations may limit the length of the socket's listen queue. If backlog exceeds the implementation-dependent maximum queue length,
the length of the socket's listen queue will be set to the maximum supported value.
The socket in use may require the process to have appropriate privileges to use the listen() function.
RETURN VALUES
Upon successful completions, listen() returns 0. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The listen() function will fail if:
EBADF The socket argument is not a valid file descriptor.
EDESTADDRREQ The socket is not bound to a local address, and the protocol does not support listening on an unbound socket.
EINVAL The socket is already connected.
ENOTSOCK The socket argument does not refer to a socket.
EOPNOTSUPP The socket protocol does not support listen().
The listen() function may fail if:
EACCES The calling process does not have the appropriate privileges.
EINVAL The socket has been shut down.
ENOBUFS Insufficient resources are available in the system to complete the call.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
accept(3XNET), connect(3XNET), socket(3XNET), attributes(5), standards(5)
SunOS 5.11 10 Jun 2002 listen(3XNET)