 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
JBB Guest
|
Posted: Fri Dec 15, 2006 9:51 pm Post subject: UDP socket |
|
|
How do i create UDP sockets in Delphi? ( native Delphi, not .Net)
Thanks |
|
| Back to top |
|
 |
Steve Guest
|
Posted: Sun Dec 17, 2006 4:59 am Post subject: Re: UDP socket |
|
|
On 16/12/2006 12:51 AM, JBB wrote:
| Quote: | How do i create UDP sockets in Delphi? ( native Delphi, not .Net)
Thanks
What it boils down to, is that you use the routines from the WinSock unit. |
There are many things out there on the net for handling sockets, and
some will handle UDP as well as TCP sockets.
For my application I grabbed an example which was designed for TCP and
"hacked" it to use UDP. Since UDP is connectionless, the hack involved
removing some code and changing parameters to specify UDP rather than
TCP. Since most of the logic is similar between these packet types, and
because WinSock is handling the nitty gritty details, it's not a
difficult hack.
Oh, hang on a sec. I actually hacked the code I used to handle
broadcast datagrams, which are different again, but in a sense quite
similar to UDP.
he hardest trick with sockets and delphi is getting a component that
will generate events without requiring a form. The winsock rotuines
(from memory) all required a window handle if they were to generate
events. My (rather slack) approach was to create a hidden form, even in
console applications. :-(
I hope this helps, She Who Must Be Obeyed is calling me. I'll see if I
can get away to find some code and post it later...
Steve |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|