Skip to content
GitLab
Menu
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
fc6ae220
Commit
fc6ae220
authored
Apr 10, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Merge branch 'develop' of
https://git.rwth-aachen.de/ita/VANet
into develop
parents
3bfce9be
a68b0e89
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/VANetMessage.cpp
View file @
fc6ae220
...
...
@@ -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
);
}
...
...
src/VANetServerImpl.cpp
View file @
fc6ae220
...
...
@@ -218,8 +218,11 @@ public:
m_mapConnections
[
nUpdateID
]
->
SetWaitForDescriptorEventSelectIsEnabled
(
true
);
}
}
catch
(
CVAException
&
)
catch
(
CVAException
&
e
)
{
#ifdef VANET_SERVER_VERBOSE
std
::
cerr
<<
"VA Server: caught exception and will disconnect now ("
<<
e
<<
")"
<<
std
::
endl
;
#endif
m_pParent
->
RemoveClient
(
m_mapConnections
[
nUpdateID
],
CVANetNetworkProtocol
::
VA_NET_SERVER_DISCONNECT
);
}
return
false
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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