Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Modules

ADT
Database
GTK2
GUI
IP
PiJAX
Public
Sql
Stdio
Subversion
System
Tools
Xosd
lua
v4l2
wx

Recent Changes

Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0

Popular Downloads

Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48


Pike Module Reference:

module version 1, prepared

  MODULE Public
Modules
Protocols

  MODULE Public.Protocols
Modules
MQTT

  MODULE Public.Protocols.MQTT
Modules
Protocols

  MODULE Public.Protocols.MQTT.Protocols
Modules
MQTT

  MODULE Public.Protocols.MQTT.Protocols.MQTT
Classes
MQTTServer
Message
client
protocol

Description

MQTT v3.1 support

  CLASS Public.Protocols.MQTT.Protocols.MQTT.MQTTServer
Methods
get_port()
set_connection_program()
set_port_object()
start()

Method get_port

object(Stdio.Port) Public.Protocols.MQTT.Protocols.MQTT.MQTTServer()->get_port()


Method set_connection_program

void Public.Protocols.MQTT.Protocols.MQTT.MQTTServer()->set_connection_program(program conn_program)


Method set_port_object

void Public.Protocols.MQTT.Protocols.MQTT.MQTTServer()->set_port_object(object(Stdio.Port) port_object)


Method start

void Public.Protocols.MQTT.Protocols.MQTT.MQTTServer()->start()

  CLASS Public.Protocols.MQTT.Protocols.MQTT.Message
Methods
decode_body()

Method decode_body

void Public.Protocols.MQTT.Protocols.MQTT.Message()->decode_body(object(Stdio.Buffer) body)

Description

decode both the variable_header (if any) and payload (if any)

  CLASS Public.Protocols.MQTT.Protocols.MQTT.client
Methods
connect()
connect()
create()
create()
publish_sync()
set_disconnect_callback()
set_will_and_testament()
subscribe()
unsubscribe()
Description

MQTT client


Method connect

void Public.Protocols.MQTT.Protocols.MQTT.client()->connect(function(object(.client) : void) _connect_cb)


Method connect

void Public.Protocols.MQTT.Protocols.MQTT.client()->connect()


Method create

void Public.Protocols.MQTT.Protocols.MQTT.client()->create(string _host, int _port)


Method create

void Public.Protocols.MQTT.Protocols.MQTT.client()->create(string _connect_url)

Description

create a client

Parameter _connect_url

A url in the form of mqtt://[user[:password]@][hostname][:port] or mqtts://[user[:password]@][hostname][:port]


Inherit protocol

  • .protocol

  • Method publish_sync

    void Public.Protocols.MQTT.Protocols.MQTT.client()->publish_sync(string topic, string msg, int|void qos_level)

    Description

    publish a message synchronously and if QOS level requires a response, wait before returning.

    Note

    synchronous publishing is far slower than asynchnronous publishing using publish.


    Method set_disconnect_callback

    void Public.Protocols.MQTT.Protocols.MQTT.client()->set_disconnect_callback(function(object(.client), object(.Reason) : void) cb)


    Method set_will_and_testament

    void Public.Protocols.MQTT.Protocols.MQTT.client()->set_will_and_testament(string topic, string message, int(0..2) qos)


    Method subscribe

    void Public.Protocols.MQTT.Protocols.MQTT.client()->subscribe(string topic, function(object(.client), string, string : void) publish_cb)


    Method unsubscribe

    void Public.Protocols.MQTT.Protocols.MQTT.client()->unsubscribe(string topic, function(object(.client), string, string : void) publish_cb)

      CLASS Public.Protocols.MQTT.Protocols.MQTT.protocol
    Methods
    disconnect()
    get_client_identifier()
    get_will_message()
    get_will_qos()
    get_will_topic()
    is_connected()
    publish()
    set_client_identifier()
    set_publish_response_timeout()
    set_qos_level()
    set_response_timeout()
    set_retry_attempts()
    set_ssl_context()

    Method disconnect

    void Public.Protocols.MQTT.Protocols.MQTT.protocol()->disconnect()


    Method get_client_identifier

    string Public.Protocols.MQTT.Protocols.MQTT.protocol()->get_client_identifier()


    Method get_will_message

    string Public.Protocols.MQTT.Protocols.MQTT.protocol()->get_will_message()


    Method get_will_qos

    int(0..2) Public.Protocols.MQTT.Protocols.MQTT.protocol()->get_will_qos()


    Method get_will_topic

    string Public.Protocols.MQTT.Protocols.MQTT.protocol()->get_will_topic()


    Method is_connected

    int Public.Protocols.MQTT.Protocols.MQTT.protocol()->is_connected()


    Method publish

    void Public.Protocols.MQTT.Protocols.MQTT.protocol()->publish(string topic, string msg, int|void qos_level, function failure_cb)

    Description

    publish a message and return immediately.

    Note

    all I/O performed by this message happens in the backend, so any code that calls this method must return to the backend before any work is done.


    Method set_client_identifier

    void Public.Protocols.MQTT.Protocols.MQTT.protocol()->set_client_identifier(string id)


    Method set_publish_response_timeout

    void Public.Protocols.MQTT.Protocols.MQTT.protocol()->set_publish_response_timeout(int secs)

    Description

    the seconds to wait for a response from the server for acknowledged publish requests

    as published messages could be larger and require more time to transmit, this timeout is configurable seprately from the acknowledged request timeout used by subscribe and unsubscribe messages.


    Method set_qos_level

    void Public.Protocols.MQTT.Protocols.MQTT.protocol()->set_qos_level(int(0..2) level)

    Description

    sets the QOS level for all subscriptions on this client


    Method set_response_timeout

    void Public.Protocols.MQTT.Protocols.MQTT.protocol()->set_response_timeout(int secs)

    Description

    the seconds to wait for a response from the server for acknowledged requests


    Method set_retry_attempts

    void Public.Protocols.MQTT.Protocols.MQTT.protocol()->set_retry_attempts(int count)

    Description

    number of times to retry transmission for requests whose acknowledgements have timed out


    Method set_ssl_context

    void Public.Protocols.MQTT.Protocols.MQTT.protocol()->set_ssl_context(object(SSL.Context) context)

    gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University