As you are saying that listener socket is not supported in google app engine environment can you provide me any other alternative other than what you provided.
def on_connect(client, userdata, flags, rc):
logging.info("Connected with result code "+str(rc))
client.subscribe("#") # wildcard for all topics
def on_message(client, userdata, msg):
logging.info(msg.topic+" "+str(msg.payload))
def work(self):
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.connect("broker.hivemq.com", 1883, 2)
client.subscribe("#")
client.loop(10)
File "/base/data/home/apps/s~xxxxxx/worker:v0.400234758085693169/worker.py", line 20, inwork client = mqtt.Client() File "/base/data/home/apps/s~sensorswarms/worker:v0.400234758085693169/lib/paho/mqtt/client.py", line 494, in __init__ self._sockpairR,self._sockpairW = _socketpair_compat() File "/base/data/home/apps/s~xxxxxxx/worker:v0.400234758085693169/lib/paho/mqtt/client.py", line 269, in _socketpair_compat listensock.bind(("127.0.0.1", 0)) File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/socket.py", line 222, in meth returngetattr(self._sock,name)(*args) File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/remote_socket/_remote_socket.py", line 676, in bind raise_SystemExceptionFromAppError(e) error: [Errno 22] Invalid argument