Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

closing a socket using it's port name.

Posted on 2001-08-20
2
Medium Priority
?
219 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 300 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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 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