Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a C++ Expert!

Join 244,306 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 789 people online right now. Registration is fast and FREE... Join Now!




sending structutres about winsocks sendto

 
Reply to this topicStart new topic

sending structutres about winsocks sendto

CrazyPlaya
15 Sep, 2008 - 11:35 PM
Post #1

New D.I.C Head
*

Joined: 7 Jul, 2008
Posts: 14



Thanked: 1 times
My Contributions
Hi @ all,

i´m trying to send an RTP Packet to a Server. My Packet Structure looks like this:

CODE

struct rtppacket
{
    unsigned int version:2;         /* protocol version */
    unsigned int padding:1;         /* padding flag */
    unsigned int extension:1;       /* header extension flag */
    unsigned int csrcccount:4;      /* CSRC count */
    unsigned int marker:1;          /* marker bit */
    unsigned int payloadtype:7;     /* payload type */
    unsigned int sequencenumber:16; /* sequence number */
    u_int32_t timestamp;            /* timestamp */
    u_int32_t ssrc;                   /* synchronization source */
    u_int32_t csrc[1];
    void* datap;
    int datalen;
}


that´s my way to fill and send the structure:
CODE

m_rtpPack.version = 2;
m_rtpPack.sequencenumber = 1;
m_rtpPack.csrc[0] = 0;
m_rtpPack.csrcccount = 0;
m_rtpPack.extension = 0;
m_rtpPack.marker = 1;
m_rtpPack.payloadtype = 0;
m_rtpPack.padding = 0;
m_rtpPack.ssrc = 0;
m_rtpPack.timestamp = GetTickCount();
...
//Buffer füllen
...
m_rtpPack.datap = szBuffer;
m_rtpPack.datalen = sizeof(szBuffer); //= 1024

nSend = sendto(m_Socket, (char*)&m_rtpPack, sizeof(m_rtpPack), 0, (SOCKADDR*)&m_saRemote, sizeof(SOCKADDR));


That doesn´t work. If I take a look of the RTP flow with packetyzer it can read the header information of rtp and the server can´t do something with incoming.
The structure padding compiler option is Zp1. What I do false?

Greetzs
CrazyPlaya

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic

Time is now: 7/4/09 06:44PM

Live C++ Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month