← Back to team overview

mosquitto-dev team mailing list archive

Re: [Question #136316]: Socket read error while connecting the broker through modem

 

Question #136316 on mosquitto changed:
https://answers.launchpad.net/mosquitto/+question/136316

    Status: Open => Needs information

Roger Light requested for more information:
> After the function call "read_length = _mosquitto_net_read(&context->core, &byte, 1);"
> the value is changed to 0;It shows the broker was not read the value in the socket.

_mosquitto_net_read() is a wrapper around the network read functions to
make it easier to provide cross platform compatibility. On Linux, this
means that _mosquitto_net_read() is exactly the same as the read() call.
When this function returns 0, it indicates end of file - in a socket
context this means that the connection has closed. This is outside the
control of the broker.

If this only happens with one type of connection hardware (the term
modem covers a wide range of different communications nowadays) then
it's likely there is a problem there rather in the broker as such.
Mosquitto is quite conservative about what it allows clients to do, so
if they misbehave or appear to misbehave then they will be disconnected.
I very much doubt that this is the case here because TCP should be
ensuring that no packets go astray.

What do you mean by modem? And does it work if the same client and
broker are connected directly through a wired lan?

-- 
You received this question notification because you are a member of
Mosquitto Dev, which is an answer contact for mosquitto.