*BSD News Article 24652


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!dog.ee.lbl.gov!hellgate.utah.edu!math.utah.edu!news.math.utah.edu!tim
From: tim@osiris.usi.utah.edu (Timothy Burns)
Subject: comp.unix.bsd
Sender: news@math.utah.edu
Date: Wed, 1 Dec 1993 21:36:40 GMT
Organization: Utah Supercomputing Institute, University of Utah
Message-ID: <TIM.93Dec1143640@osiris.usi.utah.edu>
Lines: 27

Hello,

I am currently using BSD sockets for message passing, and note that
often I cannot bind, because I am "still running on port XXXX".  I
am following (I believe) the UNIX network programming manual, but 
for some reason, I don't unbind.  Here is my code:

  sockfd = smsg_start_on_port( SMSG_PORT );
  smsg_recv( sockfd, buf, 17 );
  smsg_recv( sockfd, buf, 17 );
  close(sockfd);

Is there a unix command that will free up my port so I can bind?
I am tired of waiting 1 minute or so at odd times between code 
tests.

Thank you,

--
Tim Burns				email: tim@osiris.usi.utah.edu
USI, 85 SSB, Univ. of Utah, UT  84112  	phone: (801)581-5172
+--------------------------------------------------------------------------+
| Even the most brilliant scientific discoveries will in time change and   |
| perhaps grow obsolete, as new scientific manifestations emerge.  But Art |
| is eternal; for it reveals the inner landscape which is the soul of man. |
+----------------------------------            --Martha Graham    ---------+