Jeff Abrahamson on 5 Mar 2004 16:31:02 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] UDP and ephemeral ports


On Fri, Mar 05, 2004 at 11:07:15AM -0500, Jeff Abrahamson wrote:
>   [56 lines, 285 words, 1693 characters]  Top characters: etosnrah
> 
> I'm confused about UDP port numbers in an app I'm writing.

Ignore me.  I was using two different sockets in the more complicated
example.  So sending back to the sending socket didn't always go to
the socket where I was listening.

The problem (more fundamentally) was that I copied my sample code
without thinking things through enough.  So my sendto calls got
wrapped in calls to socket() and close().  This was appropriate in the
toy code: that's all there is to the problem.

In the more complex example, of course, I should have used the socket
I was passing to the function, not a separate one I opened for the
purpose and then forgot about.

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>
 GPG fingerprint: 1A1A BA95 D082 A558 A276  63C6 16BF 8C4C 0D1D AE4B

Attachment: signature.asc
Description: Digital signature