Solved

closing a socket using it's port name.

Posted on 2001-08-20
2
216 Views
Last Modified: 2006-11-17
Hi,

I want to close a an ephemeral port so i'll be able to bind it for recvfrom() (udp).
I noticed that shutdown() receives a sockfd but I only got the port's name.

Any ideas how do I do that?
0
Comment
Question by:naors
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
interiot earned 100 total points
ID: 6406127
From a sysadmin's standpoint, you could run something like "fuser":

    # fuser -n tcp 8000
    8000/tcp:            29178

    # ps -fp 29178    
    UID        PID  PPID  C STIME TTY          TIME CMD
    102      29178  8150  0 07:48 pts/5    00:00:00 ./junkbuster junkbstr.ini

From there, you could kill that process (or have fuser do it via -k) which would open up that tcp or udp socket.  
0
 

Author Comment

by:naors
ID: 6406406
I was trying to get an answer from a c programmer's standpoint, but nevertheless it's ok.
0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question