Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Connect behavior

Hi Roger,

Thank you for your prompt answer. Your bet is correct, I do not see this first socket connection anymore when calling loop_start after connect_async.

Thanks again,

Philippe

-----Original Message-----
From: mosquitto-dev-bounces@xxxxxxxxxxx <mosquitto-dev-bounces@xxxxxxxxxxx> On Behalf Of Roger Light
Sent: Thursday, 2 May 2019 16:01
To: General development discussions for the mosquitto project <mosquitto-dev@xxxxxxxxxxx>
Subject: Re: [mosquitto-dev] Connect behavior

Hi Philippe,

This shouldn't be behaving like this but that aside, my bet is that if you run connect first and then loop_start you won't see the spurious connect.

Regards,

Roger

On Thu, 2 May 2019 at 10:55, Philippe Willems <philippe.willems@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I use successfully the mosquito library (version 1.6) in my application with the threaded model.
>
> Everything works fine, except one strange behavior of the library. Sometimes, when the client connects to the broker, there is a first TCP SYN sequence sent by the library but without the CONNECT request. Then, after the timeout, this first TCP socket is closed by the library and a second TCP SYN is sent. In this second socket, the CONNECT request is correctly sent and everything works fine.
>
> I use the following mosquito API to set up the connection, no TLS, no username/password.
>
> mosquitto_lib_init()
> mosquitto_new()
> mosquitto_loop_start()
> mosquito_connect_async()
>
> Here is a copy of TcpDump showing this unexpected behavior.
>
> No.     Time           Source                Destination           Protocol Length Info
>       1 0.000000       192.168.42.3          188.118.5.138         TCP      74     53834 → 1883 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=5953010 TSecr=0 WS=8
>       2 0.019312       188.118.5.138         192.168.42.3          TCP      74     1883 → 53834 [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1452 WS=256 SACK_PERM=1 TSval=3637253104 TSecr=5953010
>       3 0.021792       192.168.42.3          188.118.5.138         TCP      66     53834 → 1883 [ACK] Seq=1 Ack=1 Win=29200 Len=0 TSval=5953036 TSecr=3637253104
>       4 0.997223       192.168.42.3          188.118.5.138         TCP      66     53834 → 1883 [FIN, ACK] Seq=1 Ack=1 Win=29200 Len=0 TSval=5954012 TSecr=3637253104
>       5 1.000619       192.168.42.3          188.118.5.138         TCP      74     53836 → 1883 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=5954015 TSecr=0 WS=8
>       6 1.015894       188.118.5.138         192.168.42.3          TCP      66     1883 → 53834 [ACK] Seq=1 Ack=2 Win=66048 Len=0 TSval=3637253204 TSecr=5954012
>       7 1.019364       188.118.5.138         192.168.42.3          TCP      66     1883 → 53834 [FIN, ACK] Seq=1 Ack=2 Win=66048 Len=0 TSval=3637253204 TSecr=5954012
>       8 1.021805       192.168.42.3          188.118.5.138         TCP      66     53834 → 1883 [ACK] Seq=2 Ack=2 Win=29200 Len=0 TSval=5954036 TSecr=3637253204
>       9 1.026273       188.118.5.138         192.168.42.3          TCP      74     1883 → 53836 [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1452 WS=256 SACK_PERM=1 TSval=3637253204 TSecr=5954015
>      10 1.028782       192.168.42.3          188.118.5.138         TCP      66     53836 → 1883 [ACK] Seq=1 Ack=1 Win=29200 Len=0 TSval=5954043 TSecr=3637253204
>      11 1.031684       192.168.42.3          188.118.5.138         MQTT     101    Connect Command
>      12 1.050238       188.118.5.138         192.168.42.3          MQTT     70     Connect Ack
>      13 1.052704       192.168.42.3          188.118.5.138         TCP      66     53836 → 1883 [ACK] Seq=36 Ack=5 Win=29200 Len=0 TSval=5954067 TSecr=3637253207
>
> Is this something known?
>
> Regards,
>
> Philippe
> _______________________________________________
> mosquitto-dev mailing list
> mosquitto-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or 
> unsubscribe from this list, visit 
> https://www.eclipse.org/mailman/listinfo/mosquitto-dev
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev

Back to the top