Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

socket_create_listen(3) [php man page]

SOCKET_CREATE_LISTEN(3) 						 1						   SOCKET_CREATE_LISTEN(3)

socket_create_listen - Opens a socket on port to accept connections

SYNOPSIS
resource socket_create_listen (int $port, [int $backlog = 128]) DESCRIPTION
socket_create_listen(3) creates a new socket resource of type AF_INET listening on all local interfaces on the given port waiting for new connections. This function is meant to ease the task of creating a new socket which only listens to accept new connections. PARAMETERS
o $port - The port on which to listen on all interfaces. o $backlog - The $backlog parameter defines the maximum length the queue of pending connections may grow to. SOMAXCONN may be passed as $backlog parameter, see socket_listen(3) for more information. RETURN VALUES
socket_create_listen(3) returns a new socket resource on success or FALSE on error. The error code can be retrieved with socket_last_error(3). This code may be passed to socket_strerror(3) to get a textual explanation of the error. NOTES
Note If you want to create a socket which only listens on a certain interface you need to use socket_create(3), socket_bind(3) and socket_listen(3). SEE ALSO
socket_create(3), socket_create_pair(3), socket_bind(3), socket_listen(3), socket_last_error(3), socket_strerror(3). PHP Documentation Group SOCKET_CREATE_LISTEN(3)

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.10 8 Nov 1999 listen(3SOCKET)
Man Page

10 More Discussions You Might Find Interesting

1. Programming

[Problem]Reuse port in BSD socket

I write a chat server using BSD socket, which is listen to an specific port, say 1212. After the chat server is shutdown, I want to execute the program again. But kernel will say that the port 1212 is now unavailable. I have to wait for a while to reuse the port 1212. I am sure there's no... (1 Reply)
Discussion started by: Namely
1 Replies

2. IP Networking

newbie terminology question...

is there a difference between a "port" and a "socket"? (2 Replies)
Discussion started by: trostycp
2 Replies

3. Programming

Multihomed Client

Hi, I am writing a socket program at the moment that uses both of the clients network interfaces. The program tries to create two socket connections to the server over a LAN connection and a GPRS connection. I have tried to update the routing table using the route command but that proved... (0 Replies)
Discussion started by: mhynes
0 Replies

4. Cybersecurity

ports security need help

I wrote a perl socket program which listens on 40011 port number the program works fine. But just a question crossed in my mind I tried to find the answer but I didn't find. Please if anyone have the answer or idea please reply... How to know that which ports are bocked on the UNIX (HP-UX)... (2 Replies)
Discussion started by: zing_foru
2 Replies

5. UNIX for Advanced & Expert Users

socket programming doubt

can we create multiple sockets in a machine with different ip addresses and all port listen to one single port ???? i hav one tool which creates virtual interface and i m using that to create multiple ip addresses in a linux machine and i use thos eip addresses to create multiple sockets and... (1 Reply)
Discussion started by: kic
1 Replies

6. AIX

Port hang issue in AIX Version 5.3

On AIX platform we are having Weblogic 8.1 as the middleware for an application. The application is deployed in Weblogic on AIX platform and the server is having 2 dedicated listening ports for any incoming requests. Output for netstat -an command for the port 30001 is as follows:- tcp4... (7 Replies)
Discussion started by: subharai
7 Replies

7. Programming

creating socket()

deleted (7 Replies)
Discussion started by: satish@123
7 Replies

8. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies

9. UNIX for Dummies Questions & Answers

some basic unix questions pls iam a newbie

what is a assembler what isa interpreter what is a compiler what is a socket what is a port what is meant by listening to a port how we do it how to know version and standard of unix one is using when one is on public access unix account how to see a jobid in... (1 Reply)
Discussion started by: scimitar
1 Replies

10. Red Hat

Too many CLOSE_WAIT connections

Hi, I am running JBOSS 6 ona RHEL5 server put it continuously crashes due to the number of CLOSE_WAIT connections on port 8080. How can I kill the several hundred CLOSE_WAIT connections without killing the actual live "LISTENING" connection? R, D. (2 Replies)
Discussion started by: Duffs22
2 Replies