dm_im_connect Function

public function dm_im_connect(im, host, port, jid, password, callback, user_data, resource, keep_alive, tls_required, tls_trusted) result(rc)

Connects to XMPP server.

The function returns the following error codes:

  • E_INVALID if host, jid, or password are empty, or port is invalid.
  • E_IO if the connection attempt failed.
  • E_NULL if the XMPP context is not associated.
  • E_XMPP if a connection context could not be created.

Arguments

Type IntentOptional Attributes Name
type(im_type), intent(inout) :: im

IM context type.

character(len=*), intent(in) :: host

XMPP server (IP address or FQDN).

integer, intent(in) :: port

XMPP server port.

character(len=*), intent(in) :: jid

IM ID (JID).

character(len=*), intent(in) :: password

JID account password.

procedure(dm_im_connection_callback) :: callback

IM connection handler.

type(c_ptr), intent(in), optional :: user_data

C pointer to user data.

character(len=*), intent(in), optional :: resource

Optional resource (<jid>@<domain>/<resource>).

logical, intent(in), optional :: keep_alive

Enable TCP Keep Alive.

logical, intent(in), optional :: tls_required

TLS is mandatory.

logical, intent(in), optional :: tls_trusted

Trust TLS certificate.

Return Value integer


Calls

proc~~dm_im_connect~~CallsGraph proc~dm_im_connect dm_im_connect xmpp_conn_new xmpp_conn_new proc~dm_im_connect->xmpp_conn_new xmpp_conn_set_flags xmpp_conn_set_flags proc~dm_im_connect->xmpp_conn_set_flags xmpp_conn_set_jid xmpp_conn_set_jid proc~dm_im_connect->xmpp_conn_set_jid xmpp_conn_set_pass xmpp_conn_set_pass proc~dm_im_connect->xmpp_conn_set_pass xmpp_conn_set_sm_state xmpp_conn_set_sm_state proc~dm_im_connect->xmpp_conn_set_sm_state xmpp_conn_set_sockopt_callback xmpp_conn_set_sockopt_callback proc~dm_im_connect->xmpp_conn_set_sockopt_callback xmpp_connect_client xmpp_connect_client proc~dm_im_connect->xmpp_connect_client