UDP concept help please

P

person

Hi,

I'm trying to write a program to capture a torrent of UDP messages.
The way I understand it, UDP is an unreliable protocol and packets can
be lost. However, I want to maximize the amount of traffic I capture
from the port. My first idea was to have a process with one thread
that just watched the port and stuffed each UDP message into a message
queue. Another thread in the same process would fetch messages from
the queue and do whatever with it.

This idea performed so poorly that I have to conclude it was a bad
idea. Does anyone on the list do this sort of thing? Does anyone have
an idea about how to do this, that they're willing to share?

Any help here will be greatly appreciated! I'm using gnu c running in
the cygwin environment on w2k platform.

Thanks,
Frank
 
J

Jordan Abel

I'm trying to write a program to capture a torrent of UDP messages.
The way I understand it, UDP is an unreliable protocol and packets can
be lost. However, I want to maximize the amount of traffic I capture
from the port. My first idea was to have a process with one thread
that just watched the port and stuffed each UDP message into a message
queue. Another thread in the same process would fetch messages from
the queue and do whatever with it.

If packets are lost it will probably be because of network conditions [line
noise, transmission errors, etc] not because you didn't pick them up in time as
you seem to think
 
C

Christopher Benson-Manica

person said:
I'm trying to write a program to capture a torrent of UDP messages.
The way I understand it, UDP is an unreliable protocol and packets can
be lost. However, I want to maximize the amount of traffic I capture
from the port. My first idea was to have a process with one thread
that just watched the port and stuffed each UDP message into a message
queue. Another thread in the same process would fetch messages from
the queue and do whatever with it.

(Oops, wrong group. I suggest comp.unix.programmer.)

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.
 
B

Barry

person said:
Hi,

I'm trying to write a program to capture a torrent of UDP messages.
The way I understand it, UDP is an unreliable protocol and packets can
be lost. However, I want to maximize the amount of traffic I capture
from the port. My first idea was to have a process with one thread
that just watched the port and stuffed each UDP message into a message
queue. Another thread in the same process would fetch messages from
the queue and do whatever with it.

This idea performed so poorly that I have to conclude it was a bad
idea. Does anyone on the list do this sort of thing? Does anyone have
an idea about how to do this, that they're willing to share?

Any help here will be greatly appreciated! I'm using gnu c running in
the cygwin environment on w2k platform.

Thanks,
Frank

OT - but you could google winpcap
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top