Winsock API

KaReL
01-31-2001, 05:54 PM
I've looked & looked & looked anywhere on the web, but nowhere i found HOW to make an UDP connection via the winsock control using API's.

For tcp/ip there r many tutors/source snippets... but udp???
can ANYONE here tell me how it could be done?

adebuigny
02-02-2001, 09:18 AM
I'm confused. You don't need to use API's if you use the Winsock Control. It takes care of all of that for you, and using the UDP protocol is easily changed by changing the protocol property of the winsock control.

Do I have this much right? If so, you need only understand this about UDP. You won't ever get a response back from UDP. You send it and trust that it will get to its destination. Other than that, the examples that cover TCP protocol transmissions can apply, except you don't have to worry about processing the return signals.

Good luck.

KaReL
02-02-2001, 09:28 AM
I know i know ... I just want to do it VIA code because you can't use the winsock control @ our school (disabled, although you can directly call into the dll -> stupid sysadmins :p [hope they don't read this])

adebuigny
02-02-2001, 09:36 AM
Okay. Gotta do it from code. Try www.allapi.net. They have excellent documentation on most of Microsofts API calls, including Socket, which is what you need. The socket example in particular is quite detailed.

Good Luck

Derek Stone
02-03-2001, 07:48 PM
I got to ask.
Why in the world would you ever want to use UDP?
It has absolutely no error correction, and its reliability is spotty.
The only upside is its faster.

Good Luck
-cl

<a href="http://vb.wsoftware.net" target="_new">http://vb.wsoftware.net</a>

adebuigny
02-05-2001, 07:41 AM
Well, he has to use it because thats what his assignments requires. As far as what other reason to use it, Simple Network Management Protocol uses it, so if you want to give your project the ability to be managed or monitored remotely from many of the popular SNMP tools, UDP is the way to go.

Derek Stone
02-05-2001, 01:22 PM
Actually, if you're working in a networked environment (LAN) you can easily manage, monitor, and test any protocal using any machine on the network.

-cl

<a href="http://vb.wsoftware.net" target="_new">http://vb.wsoftware.net</a>

adebuigny
02-05-2001, 02:27 PM
While this is true, other protocols create problems if you are dealing with a large network or a large number of managed devices. The traffic from management software could choke the network.

SNMP uses UDP because of the speed. It does give up reliability, but most SNMP agents, upon detecting a fault, will send messages at regular intervals until the problem is resolved. Eventually, your message will get through.

As with any programming case, the solution should always be tailored to the environment, with consideration for future growth needs. UDP is a good choice for large scale interdevice communication of a non-critical nature.

Derek Stone
02-06-2001, 01:59 PM
I agree with you totally on your above post adebuigny.
And in case anyone cares I am still looking for a nice Winsock API example to help the original poster out.

-cl

<a href="http://vb.wsoftware.net" target="_new">http://vb.wsoftware.net</a>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum