Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
VANet
Commits
a68b0e89
Commit
a68b0e89
authored
Apr 10, 2017
by
Jonas Stienen
Browse files
Removing (now) useless exception raise
parent
79ad52a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/VANetMessage.cpp
View file @
a68b0e89
...
...
@@ -123,16 +123,19 @@ void CVANetMessage::ReadMessage()
if
(
nMessageSize
>
(
int
)
m_vecIncomingBuffer
.
size
()
)
m_vecIncomingBuffer
.
resize
(
nMessageSize
);
int
iBytesRe
ceive
dTotal
=
0
;
while
(
nMessageSize
>
iBytesRe
ceive
dTotal
)
int
iBytesRe
a
dTotal
=
0
;
while
(
nMessageSize
!=
iBytesRe
a
dTotal
)
{
int
iIncommingBytes
=
m_pConnection
->
WaitForIncomingData
(
0
);
int
iBytesReceived
=
m_pConnection
->
ReadRawBuffer
(
&
m_vecIncomingBuffer
[
iBytesReceivedTotal
],
iIncommingBytes
);
iBytesReceivedTotal
+=
iBytesReceived
;
int
iBytesRead
=
0
;
if
(
iBytesReadTotal
+
iIncommingBytes
>
nMessageSize
)
iBytesRead
=
m_pConnection
->
ReadRawBuffer
(
&
m_vecIncomingBuffer
[
iBytesReadTotal
],
nMessageSize
-
iBytesReadTotal
);
// read residual bytes
else
iBytesRead
=
m_pConnection
->
ReadRawBuffer
(
&
m_vecIncomingBuffer
[
iBytesReadTotal
],
iIncommingBytes
);
// read all incominb bytes
iBytesReadTotal
+=
iBytesRead
;
}
if
(
iBytesReceivedTotal
!=
nMessageSize
)
VA_EXCEPT2
(
NETWORK_ERROR
,
"Reading message, but received less bytes than expected."
);
assert
(
iBytesReadTotal
==
nMessageSize
);
m_oIncoming
.
SetBuffer
(
(
VistaType
::
byte
*
)
&
m_vecIncomingBuffer
[
0
],
nMessageSize
,
false
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment