C-код sendmsg () и recvmsg () передают bigdata через UDP в интернете или интрасети
I am trying to send big data more than 1gb over UDP.I try to learn all parameter of sendmsg() and recvmsg() but not get the idea how to fragment and how to again reassemble data using c programming. I search on google every side tell that how to set a parameter in iovec and cmsghdr but no one explain about how to fragment and reassemble data another end. some example I found that says send a single buffer of data and tell that manage offset based on return value of sendmsg() but I don't think this is the best way of doing. On completion, I will add feature broadcast so I am only looking P.I know that over TCP problem makes easier but my requirement is UDP. please suggest me how to fragment and reassemble data in c language. and my English not good so sorry for that.
Что я уже пробовал:
typedef struct header_long_t { uint32_t magic; uint32_t msg_seqno; uint32_t msg_size; uint32_t fragment_offset; uint16_t fragment_no; uint16_t fragments_in_msg; }header_long_t;
но не успех.