Socket Datagram info sendto(), recvfrom()

This is a discussion on Socket Datagram info sendto(), recvfrom() within the C Programming forums, part of the General Programming Boards category; Hi, i'm new , and i like so much this forum! i've a question about socket datagram, can i send ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    1

    Socket Datagram info sendto(), recvfrom()

    Hi, i'm new , and i like so much this forum!
    i've a question about socket datagram, can i send a struct directli with the function sendto (..) ? or I have only the possibility to send vector of char ??
    i need to send a frame with Data , Cecksum, and number of packet, using Datagram UDP . . .

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,764
    You can send any contiguous block of memory you like (up to around 1500 bytes).

    But watch out for endian and alignment issues - different machines will interpret the data differently unless you're careful.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Raw socket
    By like_no_other in forum Networking/Device Communication
    Replies: 4
    Last Post: 03-28-2009, 03:05 PM
  2. Raw socket and sendto()
    By matB in forum Networking/Device Communication
    Replies: 4
    Last Post: 07-10-2008, 06:07 PM
  3. sendto Socket packet size
    By bj00 in forum Networking/Device Communication
    Replies: 0
    Last Post: 07-27-2007, 12:05 PM
  4. Datagram Unix socket problem
    By karas in forum C Programming
    Replies: 9
    Last Post: 07-27-2006, 11:08 AM
  5. Help doing an e-mail program in c...
    By Tyler_Durden in forum C Programming
    Replies: 88
    Last Post: 01-02-2005, 03:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21