Discussion:
Socket error 10048 on UDP broadcast
(too old to reply)
Tim Roberts
2009-08-28 03:46:13 UTC
Permalink
I have an application that reads captured data from a file, crunches it,
and spews 5 or 6 processed data streams by broadcasting out to UDP ports.
This process is computationally intensive, and sucks up about 60% of a CPU.

Then, there are a number of secondary applications that listen to those UDP
ports and create various user interface windows.

Here's the problem. Occasionally, if I fire up one of the listener
applications while the data cruncher is already running and broadcasting
its data streams, I will get a 10048 error from the listener's call to
connect (WSAEADDRINUSE -- "address already in use"). After that happens, I
can never listen to that socket again. Every connect attempt from then on
gets 10048. The only solution is to reboot.

When this happens, "netstat" does not show anybody listening to my port.

Now, to a certain extent, I can avoid this problem by doing things in a
different order (listener first, cruncher second), but that's not how it
should be.

Anyone have any clues about how I can chase this down?
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
h***@40th.com
2009-08-29 06:49:24 UTC
Permalink
You didn't close the socket handle for the
port when you last got rid of it - or thought
you got rid of it. try/finally works well,
and I see your goto and raise you a longjmp.
Then again, your code could be correct, and
the LL sockets code is duff -- it's always
my first inclination.
--
40th Floor - Software @ http://40th.com/
PhantasmX3 - The finest sound in the world
phantasm.40th.com ppc netbook
Continue reading on narkive:
Loading...