Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tuio_cpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
tuio_cpp
Commits
50aa8715
Commit
50aa8715
authored
8 years ago
by
Martin Kaltenbrunner
Browse files
Options
Downloads
Patches
Plain Diff
fix bundle_size decoding
parent
b39900a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
TUIO/TcpReceiver.cpp
+9
-8
9 additions, 8 deletions
TUIO/TcpReceiver.cpp
with
9 additions
and
8 deletions
TUIO/TcpReceiver.cpp
+
9
−
8
View file @
50aa8715
...
...
@@ -39,6 +39,7 @@ static void* ClientThreadFunc( void* obj )
TcpReceiver
*
sender
=
static_cast
<
TcpReceiver
*>
(
obj
);
char
data_buffer
[
MAX_TCP_SIZE
+
4
];
char
data_size
[
4
];
int32_t
bundle_size
;
#ifdef WIN32
SOCKET
client
=
sender
->
tcp_client_list
.
back
();
...
...
@@ -53,15 +54,15 @@ static void* ClientThreadFunc( void* obj )
if
(
bytes
>=
4
)
{
memcpy
(
&
data_size
[
0
],
&
data_buffer
[
0
],
4
);
#ifdef OSC_HOST_LITTLE_ENDIAN
int32_t
temp
=
(
int32_t
)(
*
data_size
);
data_size
[
0
]
=
temp
>>
24
;
data_size
[
1
]
=
(
temp
>>
16
)
&
255
;
data_size
[
2
]
=
(
temp
>>
8
)
&
255
;
data_size
[
3
]
=
(
temp
)
&
255
;
bundle_size
=
0xFF
&
data_size
[
3
];
bundle_size
|=
(
0xFF
&
data_size
[
2
])
<<
8
;
bundle_size
|=
(
0xFF
&
data_size
[
1
])
<<
16
;
bundle_size
|=
(
int32_t
)(
0xFF
&
data_size
[
0
])
<<
24
;
#else
bundle_size
=
(
int32_t
)(
*
data_size
);
#endif
int32_t
size
=
(
int32_t
)(
*
data_size
);
if
(
size
+
4
==
bytes
)
{
sender
->
ProcessPacket
(
&
data_buffer
[
4
],(
int
)
size
,
IpEndpointName
());
if
(
bundle_size
+
4
==
bytes
)
{
sender
->
ProcessPacket
(
&
data_buffer
[
4
],(
int
)
bundle_size
,
IpEndpointName
());
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment