Socket, Socket, whose got the socket?

Socket, Socket, whose got the socket?

Post by Mark Re » Tue, 11 Mar 1997 04:00:00



For any Unix/TCP socket types out there:

I need a way to tie an open socket to it's creating process.  Netstat
doesn't seem to be the answer, as it returns only usage statistics, but
no process-specific information.  

Thanks (from a VMS person -- gee, that'll really enhance my chances of
getting a response ;-)).  BTW, on VMS, for any of you versed in both
OS's, you'd accomplish it with the following:

UCX> sh dev/port=1575
                              Port                       Remote
  Device_socket  Type    Local  Remote  Service           Host
    bg4553      STREAM    1526       0                   0.0.0.0

$sh dev/fu bg4553

Device BG4553:, device type unknown, is online, mounted, record-oriented
device, network device, mailbox device.

 Error count                    0    Operations completed                249
 Owner process  "ORA_TNS1F18C718"    Owner UIC                       [MREIS]
 Owner process ID        37201155    Dev Prot    S:RWPL,O:RWPL,G:RWPL,W:RWPL
 Reference count                1    Default buffer size                  25
--
 _____                                                                _____
( ___ )--------------------------------------------------------------( ___ )

 | / | Danville, CA          http://www.ccnet.com/~reis               | \ |
 | / |                                                                | \ |
 |___|  "You never know when you're makin' a memory" - R. L. Jones    |___|
(_____)--------------------------------------------------------------(_____)

 
 
 

Socket, Socket, whose got the socket?

Post by Chook » Sun, 16 Mar 1997 04:00:00



> For any Unix/TCP socket types out there:

> I need a way to tie an open socket to it's creating process.  Netstat
> doesn't seem to be the answer, as it returns only usage statistics, but
> no process-specific information.

What is it you are exactley trying to achieve ???

If you are trying to make the socket accept connections then see the man
page on bind.  This explains how to set up a socket to accept
connections.

If you are tring to monitor what the socket is receiving I'd think you'd
either have to write the code to do this or monitor the TCP/IP stack.

Good luck.
David H.
--


 
 
 

Socket, Socket, whose got the socket?

Post by B.A.McCau.. » Wed, 19 Mar 1997 04:00:00



>I need a way to tie an open socket to it's creating process.  Netstat
>doesn't seem to be the answer, as it returns only usage statistics, but
>no process-specific information.  

I too would like to know a general answer to this.  I answered this
same question on a Linux group a couple of weeks ago but I don't think
the Linux solution is portable.

--

 .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
 # ll  l\\  ~~~~ ~   ~ ~    ~ | http://wcl-l.bham.ac.uk/~bam/