Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: How to format/send/receive UDP packet in C?

Thread Tools

Re: How to format/send/receive UDP packet in C?

Tom St Denis
Posts: n/a
Abby wrote:
> I'd like to ask about how to format/send/receive UDP datagram packet
> in C language. The server that I'd like to send the packet to is
> listening on port 1500. When I succesfully connect to that port, it's
> gonna create and send a packet back to the client. The only code I
> need to write is the client-side code. The problem is, I don't have
> any idea how to:
> 1. Send data packet to server (I'm going to send the data in Hex
> format)
> 2. Receive data back from that server
> I also don't have any idea how to format the packet. Please give me a
> simple explanation. Thank you so much.
> PS. I searched for example code, but I got only the one that show me
> how to send packet to server. No code show me how to also receive the
> packet.

This is wildly off topic for clc but what the heck.

UDP is connectionless. You send packets but you don't actively make a
stateful connection with the destination [e.g. no way to know if it gets

To receive UDP packets you have to be listening [e.g. bind to a UDP port].


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
VoIP: UDP Packet compression to save bandwidth... groobo Cisco 5 10-17-2005 10:23 PM
Cisco CSS Load Balancing Radius UDP Packet digiusto Cisco 0 03-06-2005 09:41 AM
UDP/IP packet question Kott Cisco 4 07-13-2004 03:59 PM
udp (0) -> udp (0) traffic ? Tom Cisco 2 03-04-2004 06:06 PM