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
Solved

closing a socket using it's port name.

Posted on 2001-08-20
2
213 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Where is my core dump file in Ubuntu? 12 454
stopping a java process started with daemon command 2 79
php session folder question (Code Igniter) 3 102
awk file 6 79
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 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