Jump to content
  • Advertisement
Sign in to follow this  
-Tau-

RakNet::RakPeerInterface::Send is there a limit?

Recommended Posts

Is there a limit and if yes how big can the struct send by RakNet::RakPeerInterface::Send be?

I'm trying to make a Raspberry Pi camera client that would stream video from Raspberry client to PC server, however client always crashes on:

m_Client->Send((char*)m_cData, sizeof(CameraData1280x720), HIGH_PRIORITY, RELIABLE_ORDERED, 0, m_ServerGuid, false);

I tried to reduce the size of data that had to be sent by passing sizeof(CameraData1280x720) /100 and it worked.

So again, is there a limit on how big the struct send by RakNet::RakPeerInterface::Send can be or am i doing something else wrong?

Share this post


Link to post
Share on other sites
Advertisement

There are many "soft" limits.

There's the limit on an underlying Ethernet/ATM/whatever transmission packet; these vary between 48 (ATM cells) and 9000 (Ethernet Jumbo frames) or so. Upper layers will fragment across these. If you send a bigger datagram, the IP layer will fragment across this. (Unless Dont Fragment is set.)

There's the limit on UDP datagrams, where a single datagram is limited to 65535 bytes. RakNet will fragment across these -- if you send something bigger, it will send many UDP datagrams.

RakNet adds some internal book-keeping, so in practice, you will get multiple UDP datagrams on payloads less than 65535 bytes. RakNet will also fragment its own messages down to the MTU (the internal limitation of IP datagrams.)

So, no, I don't think there is a FIXED limit to the upper size, but there are of course practical limits to what will work in some particular networking situation.

 

Share this post


Link to post
Share on other sites

So... 640x480 @ 30fps that's

640*480*3*30*8 = 221184000 = 221 Mbps

It is possible that RakNet can't handle this.

I will try to find something for video compression

Share this post


Link to post
Share on other sites

The Raspberry Pi can compress to H264 using its GPU. It's one of the few things it's good at 🙂

The samples for the video capture/compress software are somewhat ... hard-coded to their tasks, but you can extract the "start the camera" and "run the hardware compressor" bits from the code and re-use in your own program. It's mainly an exercise in figuring out which bits you really need, and which large chunks you should cut out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!