tags:

views:

70

answers:

3
+4  A: 

29 is the socket number, you will use that in your calls to other socket-API functions (bind, connect, etc).

You don't see it in netstat because you haven't bound it to anything yet. In order for it to show up there, call connect or bind, accept, listen (depending on what you plan to do with it).

bstpierre
A: 

The return code from socket() is just the file descriptor, not the port number. If your intention is to create a server, then you need to call listen(), bind(), and accept().

chrisaycock
+1  A: 

Maybe you should bind(), listen() and accept() (if this is a server) or connect() (if client) before you can see it in netstat.

BTW, use netstat -a to see bound but non-connected sockets.

Edgar Bonet