Unix Technical Forum

sockets

This is a discussion on sockets within the AIX Operating System forums, part of the Unix Operating Systems category; --> Does anyone know how to disconnect a particular socket connection. I can grep out netstat for the connection and ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-04-2008, 07:50 PM
mailjoeg@yahoo.com
 
Posts: n/a
Default sockets

Does anyone know how to disconnect a particular socket connection. I
can grep out netstat for the connection and use lsof to get a list of
pids using that connection type, but I don't want to kill all of them,
just one.

Thanks,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-04-2008, 07:50 PM
Shaun Clowes
 
Posts: n/a
Default Re: sockets


<mailjoeg@yahoo.com> wrote in message
news:55ca0bf1.0307161130.166a466f@posting.google.c om...
> Does anyone know how to disconnect a particular socket connection. I
> can grep out netstat for the connection and use lsof to get a list of
> pids using that connection type, but I don't want to kill all of them,
> just one.


I'm not exactly sure what you're looking for here or why you want to do
this. One way might be to use dbx (if you have the compilers installed) and
close the filedescriptor (which lsof tells you). Something like this:

dbx -a `pidof gdb`
Waiting to attach to process 1138932 ...
Successfully attached to gdb.
warning: Directory containing gdb could not be determined.
Apply 'use' command to initialize source path.

Type 'help' for help.
reading symbolic information ...
stopped in poll at 0xd0246454
0xd0246454 (poll+0x94) 80410014 lwz r2,0x14(r1)
(dbx) call close(1)
1. glink.close [gdb]
2. glink.close [/usr/lib/libiconv.a]
3. glink.close [/usr/lib/libcurses.a]
4. glink.close [/usr/lib/libc.a]
Select one of [1 - 4]: 1

glink.close returns successfully
(dbx) cont
^C
Interrupt in poll at 0xd0246454
0xd0246454 (poll+0x94) 80410014 lwz r2,0x14(r1)
(dbx) detach

Cheers,
Shaun


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:05 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com