listen(2) System Calls Manual listen(2)Name
listen - listen for connections on a socket
Syntax
listen(s, backlog)
int s, backlog;
Description
To accept connections, a socket is first created with a call, a backlog for incoming connections is specified with and then the connections
are accepted with the call. The call is needed only for sockets of type SOCK_STREAM or SOCK_SEQPACKET.
The backlog parameter defines the maximum length the queue of pending connections may grow to. If a connection request arrives with the
queue full, the client receives an error with an indication of ECONNREFUSED.
Restrictions
The backlog is currently limited to 8.
Return Values
A 0 return value indicates success. A -1 indicates an error.
Diagnostics
The call fails under the following conditions:
[EBADF] The argument s is not a valid descriptor.
[ENOTSOCK] The argument s is not a socket.
[EOPNOTSUPP] The socket is not of a type that supports the operation
See Alsoaccept(2), connect(2), socket(2)listen(2)
Check Out this Related Man Page
listen(3SOCKET) Sockets Library Functions listen(3SOCKET)NAME
listen - listen for connections on a socket
SYNOPSIS
cc [ flag ... ] file ... -lsocket-lnsl [ library ... ]
#include <sys/types.h>
#include <sys/socket.h>
int listen(int s, int backlog);
DESCRIPTION
To accept connections, a socket is first created with socket(3SOCKET), a backlog for incoming connections is specified with listen() and
then the connections are accepted with accept(3SOCKET). The listen() call applies only to sockets of type SOCK_STREAM or SOCK_SEQPACKET.
The backlog parameter defines the maximum length the queue of pending connections may grow to.
If a connection request arrives with the queue full, the client will receive an error with an indication of ECONNREFUSED for AF_UNIX sock-
ets. If the underlying protocol supports retransmission, the connection request may be ignored so that retries may succeed. For AF_INET
and AF_INET6sockets, the TCP will retry the connection. If the backlog is not cleared by the time the tcp times out, the connect will fail
with ETIMEDOUT.
RETURN VALUES
A 0 return value indicates success; -1 indicates an error.
ERRORS
The call fails if:
EBADF The argument s is not a valid file descriptor.
ENOTSOCK The argument s is not a socket.
EOPNOTSUPP The socket is not of a type that supports the operation listen().
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO accept(3SOCKET), connect(3SOCKET), socket(3SOCKET), attributes(5), socket.h(3HEAD)NOTES
There is currently no backlog limit.
SunOS 5.11 8 Nov 1999 listen(3SOCKET)
I am not what I would call an experienced programmer.
I know some ksh etc..
I need to be able to listening on a port for incoming data on a ultra 10 using solaris 9. Basically all that I need to do at the moment is to log the incoming data on a specific port number.
Any ideas on how I... (6 Replies)
Hi All,
I'm running RH 9.0 on a PII box with 160MB RAM. Just downloaded RealVNC X86 Linux (version 3.3.7). How can I get the HTTP listening port up ?
Thanks,
KENT (6 Replies)
Hi guys, lets make this more interesting... I'm sure you listen to something when your working on a project or something... I know, I do, helps with concentration.
Track: ±¯¸èÖ®Íõ (King of sad songs)
Artist: -îǧ‹Ã Miriam Yeung
Lovely forum BTW! :D (33 Replies)
I want to write a program to list all port numbers a process like web server is listening to.Is there a any unix command to find the port numbers and the processes(pid) connected to that port. (6 Replies)
Hello Gentlemen,
Its been a looong time I have posted here. I need a clarification. We started up the OPMN service (for Oracle App server) on Linux box. The service was supposed to listen on port 6005.
The service started up and was listening to 6005 but looks like it was listening only to... (7 Replies)
Howdy Experts,
This is my first post here and I am posting because I have not been able to find an answer for this question.
How do you find out what process is listening on a given port? I do not have "lsof" available and how do we find this out without logging in as Root.
I know that this... (5 Replies)
Hi,
I am using solaris 10.
I have opened a socket connection using java in solaris 10 operating system, the port went to LISTEN state and able to create new socket connection and the new connections went to ESTABLISHED state.
If I issue the command "netstat -an | grep <<portnumber>>", I... (10 Replies)
Hello everybody, the reason why im posting this thread is because i've installed an oracle test database on RHEL 5, on a localhost (Since it is for test)... the thing is, after i have installed the DB it works just fine, but after i re start it, i get the following errors when i want to go into the... (5 Replies)
Hi!
I need your help, please.
I'm in AIX node and sometimes listener process from an oracle instance gets duplicated, i mean that it get spawned a second listener process. As we can't apply changes to the databases on this months, i want to build a shell that can identify the second... (6 Replies)
Good morning!
I would like to test a particular port in Solaris, to see if the firewall rules are ok.
Should I install an application, but as yet I have not, have to force solaris to keep an open door, and put any application listening to port 1099, and will test a terminal connectivity via... (5 Replies)
Hello guys
I am experiencing a very strange behavior on one of our AIX servers. We have an application with several processes that listen on several port numbers. Sometimes we receive complains that people cannot connect to the server on a specific port that is used by one the application... (6 Replies)
Hi,
We cant set the listen address of my java process to the IP address or any of the DNS names listen in the hosts file of the server.
We can access the resources of the pid in the web browser through http://<IP / DNS>:port/console
Based on the pid, how can we find what is the listen... (6 Replies)
Hi everyone,
This is a strange thing, sometimes when I type > exit from root session, i get a message
> There are processes running
after this message is displayed the oracle listener dies out and have to startup the listener again.
but this doesn't have always.
Where should I start to... (5 Replies)
Hi,
I am trying to write a script or command to add/remove a section from listener.ora file
in the following example I would like:
1. to remove sid_alias2 sections
2. to add a new alias sections called sid_alias4, it can be placed after sid_alias3 sections
$ cat listener.ora
... (18 Replies)
Hello,
Just wondered if there is any possibility to run a command at sharp time inside a script in linux. My question is not about crontab
Example:
#!/bin/bash
cd /home/database
for i in *
do
command 1
if time is 19:00, day is Monday then run command2
if time is 20:00, day is... (10 Replies)