1

I used Paho - MQTT client library for MQTT connection, but it takes default interface to connect the internet. Is there any MQTT API for the select specific interface like eth0/wlan0 and through it I connect to the internet.

lucifer
  • 67
  • 1
  • 4

1 Answers1

1

Paho MQTT C library does not seem to use bind() between creating the socket and calling open(), so the answer would be NO. Anyway it's opensource and from skimming the project, i went through at most 2 levels of abstraction between library interface and raw POSIX metal, so it should be fairly simple to add such functionality yourself. A random answer describing socket binding howto.

Community
  • 1
  • 1
Pavel Zdenek
  • 7,146
  • 1
  • 23
  • 38