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

Discussion in 'C Programming' started by Rahul Gandhi, Jun 24, 2003.

  1. Rahul Gandhi

    Rahul Gandhi Guest

    (Abby) wrote in message news:<>...
    > 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.



    The code for sending and recieving the UDP packets is in Unix network
    Programming by Richard Stevens.
    UDP Packet Format.
    ------------- 32 bits --------
    | Source Port | Dest Port |
    ---------------------------------
    | Udp Msg Length | UDP Checksum |
    ----------------------------------
    | UDP payload |
    | |
    | |
     
    Rahul Gandhi, Jun 24, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom St Denis

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

    Tom St Denis, Jun 24, 2003, in forum: C Programming
    Replies:
    0
    Views:
    3,114
    Tom St Denis
    Jun 24, 2003
  2. Replies:
    0
    Views:
    1,923
  3. Tom St Denis

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

    Tom St Denis, Jun 24, 2003, in forum: C Programming
    Replies:
    11
    Views:
    8,551
    Chris Torek
    Jun 26, 2003
  4. Replies:
    5
    Views:
    4,402
    Rob Sinclar
    Jul 26, 2006
  5. Li Han
    Replies:
    2
    Views:
    531
    bobicanprogram
    Feb 9, 2009
Loading...

Share This Page