Skip to content

Commit

Permalink
fixing udp id sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
peeld committed Nov 7, 2022
1 parent 0f1f357 commit a9f103b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion plugins/mobu/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,13 @@ void Open3D_Device::DeviceIONotify(kDeviceIOs pAction, FBDeviceNotifyInfo &pDev

size_t sentSz = 0;

mIdSeq++;

std::vector<char> fragData;
UdpFragmenter frag(buf.data(), bucketSize, 512);
for (int i = 0; i < frag.mFrames; i++)
{
frag.makeFragment(mIdSeq++, i, fragData);
frag.makeFragment(mIdSeq, i, fragData);
sentSz+= sendto(mNetworkSocket, fragData.data(), fragData.size(), 0,
(struct sockaddr*)&dest_addr,
(int)sizeof(struct sockaddr_in));
Expand Down
4 changes: 2 additions & 2 deletions src/o3ds/o3ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@


#define O3DS_VERSION_MAJOR 0
#define O3DS_VERSION_MINOR 20
#define O3DS_VERSION "0.20"
#define O3DS_VERSION_MINOR 21
#define O3DS_VERSION "0.21"

namespace O3DS
{
Expand Down
9 changes: 5 additions & 4 deletions src/o3ds/udp_fragment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,13 @@ bool UdpMapper::addFragment(const char* data, size_t sz)

uint32_t* heading = (uint32_t*)data;

uint32_t id = heading[0];
uint32_t frameId = heading[0];
uint32_t fragmentId = heading[1];

if (id > 40)
return false;
//if (fragmentId > 40)
// return false;

this->getCombiner(id).addFragment(data, sz);
this->getCombiner(frameId).addFragment(data, sz);
}

bool UdpMapper::getFrame(std::vector<char> &out)
Expand Down

0 comments on commit a9f103b

Please sign in to comment.