[Positioner] EvAAL: do not send \0
The NULL character must not be sent at the end of the result string, or the Socket Server behaves weirdly.
This commit is contained in:
parent
307da87760
commit
f6fa26507f
|
@ -135,7 +135,9 @@ area_of_interest_number(const Point3D &position) const
|
||||||
*/
|
*/
|
||||||
bool OutputTCPSocketEvAAL::send_data(const string &data) const
|
bool OutputTCPSocketEvAAL::send_data(const string &data) const
|
||||||
{
|
{
|
||||||
unsigned int data_len = data.size() + 1 ; // +1 for the '\0'
|
// Do *not* add one extra character for the '\0', it must not be sent!
|
||||||
|
unsigned int data_len = data.size() ;
|
||||||
|
|
||||||
ssize_t nsent = send(sockfd, data.c_str(), data_len, 0) ;
|
ssize_t nsent = send(sockfd, data.c_str(), data_len, 0) ;
|
||||||
if (nsent != static_cast<ssize_t>(data_len))
|
if (nsent != static_cast<ssize_t>(data_len))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue