Go Back   Velocity Reviews > Newsgroups > C Programming
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

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

 
Thread Tools Search this Thread
Old 06-24-2003, 01:25 AM   #1
Default Re: How to format/send/receive UDP packet in C?


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
there].

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

Tom



Tom St Denis
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump