ATSLIB/contrib/zeromq/zmq

This package contains an API for programming zeromq in ATS.


  • zmq_ctx_new
  • zmq_ctx_destroy
  • zmq_ctx_destroy_exn
  • zmq_ctx_get
  • zmq_ctx_set
  • zmq_socket
  • zmq_socket_exn
  • zmq_getsockopt
  • zmq_getsockopt2
  • zmq_setsockopt
  • zmq_bind
  • zmq_bind_exn
  • zmq_close
  • zmq_send
  • zmq_recv
  • zmq_connect
  • zmq_connect_exn
  • zmq_disconnect
  • zmq_disconnect_exn
  • zmq_msg_size
  • zmq_msg_data
  • zmq_msg_more
  • zmq_msg_get
  • zmq_msg_set
  • zmq_msg_init
  • zmq_msg_init_exn
  • zmq_msg_init_size
  • zmq_msg_init_size_exn
  • zmq_msg_init_data
  • zmq_msg_init_data_exn
  • zmq_msg_close
  • zmq_msg_close_exn
  • zmq_msg_copy
  • zmq_msg_copy_exn
  • zmq_msg_move
  • zmq_msg_move_exn
  • zmq_msg_send
  • zmq_msg_send_exn
  • zmq_msg_recv
  • zmq_msg_recv_exn
  • zmq_term
  • zmq_term_exn
  • zmq_sendmsg
  • zmq_recvmsg

  • zmq_ctx_new

    Synopsis

    fun zmq_ctx_new (): zmqctx0 = "mac#%"

    zmq_ctx_destroy

    Synopsis

    fun zmq_ctx_destroy
      {l:agz} (
      ctx: !zmqctx (l) >> zmqctxopt (l, i < 0)
    ) : #[i:int | i <= 0] int (i) = "mac#%"

    zmq_ctx_destroy_exn

    Synopsis

    fun zmq_ctx_destroy_exn (ctx: zmqctx1): void

    zmq_ctx_get

    Synopsis

    fun zmq_ctx_get
      (ctx: !zmqctx1, name: int): int = "mac#%"

    Description

    If successful, this function returns the value of the context option named by its second argument.

    Return Value

    The function returns a non-negative integer if successful, or it returns -1.

    zmq_ctx_set

    Synopsis

    fun zmq_ctx_set
      (ctx: !zmqctx1, name: int, value: int): int = "mac#%"

    Description

    If successful, this function sets the context option named to by its second argument with the value given as its third argument.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_socket

    Synopsis

    fun zmq_socket
      (ctx: !zmqctx1, type: int): zmqsock0 = "mac#%"

    Description

    This function creates a zeromq socket within the specified context and returns an opaque handle to the newly created socket.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_socket_exn

    Synopsis

    fun zmq_socket_exn (ctx: !zmqctx1, type: int): zmqsock1

    Description

    This function is the exit version of zmq_socket. After calling zmq_socket, it returns if there is no error, or it exits abnormally.

    zmq_getsockopt

    Synopsis

    fun
    zmq_getsockopt
      {a:t@ype} (
      sock: !zmqsock1
    , name: zmqsockopt(a), value: ptr, len: &size_t >> _
    ) : interr = "mac#%" // endfun

    Description

    This function gets the value of a zmq-socket option.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_getsockopt2

    Synopsis

    fun
    zmq_getsockopt2
      {a:t@ype} (
      sock: !zmqsock1
    , name: zmqsockopt(a), value: &(a)? >> a, len: &sizeof_t(a) >> _
    ) : interr = "mac#%" // endfun

    Description

    This function does the same as zmq_getsockopt but is given a more accurate type.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_setsockopt

    Synopsis

    fun
    zmq_setsockopt
      {a:t@ype} (
      sock: !zmqsock1, name: zmqsockopt(a), value: ptr, len: size_t
    ) : interr = "mac#%" // endfun

    Description

    This function sets a zmq-socket option with a given value.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_bind

    Synopsis

    fun zmq_bind (
      sock: !zmqsock1, endpt: NSH(string)
    ) : interr = "mac#%" // endfun

    zmq_bind_exn

    Synopsis

    fun zmq_bind_exn
      (sock: !zmqsock1, endpt: NSH(string)): void

    Description

    This function is the exit version of zmq_bind. After calling zmq_bind, it returns if there is no error, or it exits abnormally.

    zmq_close

    Synopsis

    fun zmq_close
      (sock: zmqsock1): interr = "mac#%"

    zmq_send

    Synopsis

    fun
    zmq_send
      {m:int}{n:int | n <= m}
    (
      sock: !zmqsock1, buf: &(@[byte][m]), len: size_t (n), flags: int
    ) : int(*verr*) = "mac#%" // end of [zmq_send]

    zmq_recv

    Synopsis

    fun
    zmq_recv
      {m:int}{n:int | n <= m}
    (
      sock: !zmqsock1, buf: &(@[byte][m]), len: size_t (n), flags: int
    ) : int(*verr*) = "mac#%" // end of [zmq_recv]

    zmq_connect

    Synopsis

    fun
    zmq_connect
    (
      sock: !zmqsock1, endpt: NSH(string)
    ) : interr = "mac#%" // endfun

    Description

    This function creates an outgoing connection from a given socket by connecting the socket to a given endpoint and then accepts incoming connections on that endpoint.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_connect_exn

    Synopsis

    fun
    zmq_connect_exn
      (sock: !zmqsock1, endpt: NSH(string)): void

    Description

    This function is the exit version of zmq_connect. After calling zmq_connect, it returns if there is no error, or it exits abnormally.

    zmq_disconnect

    Synopsis

    fun
    zmq_disconnect
    (
      sock: !zmqsock1, endpt: NSH(string)
    ) : interr = "mac#%" // endfun

    Description

    This function disconnects a given socket from a given endpoint.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_disconnect_exn

    Synopsis

    fun
    zmq_disconnect_exn
      (sock: !zmqsock1, endpt: NSH(string)): void

    Description

    This function is the exit version of zmq_disconnect. After calling zmq_disconnect, it returns if there is no error, or it exits abnormally.

    zmq_msg_size

    Synopsis

    fun zmq_msg_size (msg: &zmqmsg):<> size_t = "mac#%"

    zmq_msg_data

    Synopsis

    fun zmq_msg_data (msg: &zmqmsg):<> Ptr1 = "mac#%"

    zmq_msg_more

    Synopsis

    fun zmq_msg_more (msg: &zmqmsg):<> natLt(2) = "mac#%"

    Description

    This function returns an integer indicating whether the given message is part of a multi-part message or there are further parts to receive.

    zmq_msg_get

    Synopsis

    fun zmq_msg_get
      (msg: &zmqmsg, property: int): int(*verr*) = "mac#%"

    Description

    If successful, this function returns the value of the message property referred to by its second argument.

    Return Value

    The function returns a non-negative integer if successful, or it returns -1.

    zmq_msg_set

    Synopsis

    fun
    zmq_msg_set
    (
      msg: &zmqmsg >> _, property: int, value: int
    ) : interr = "mac#%" // endfun

    Description

    If successful, this function sets the message property referred to by its second argument with the value given as its third argument.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_msg_init

    Synopsis

    fun zmq_msg_init
    (
      msg: &zmqmsg? >> opt (zmqmsg, i==0)
    ) : #[i:int | i <= 0] int (i) = "mac#%"

    zmq_msg_init_exn

    Synopsis

    fun zmq_msg_init_exn (msg: &zmqmsg? >> _): void

    Description

    This function is the exit version of zmq_msg_init.

    zmq_msg_init_size

    Synopsis

    fun
    zmq_msg_init_size
    (
      msg: &zmqmsg? >> opt (zmqmsg, i==0), n: size_t
    ) : #[i:int | i <= 0] int (i) = "mac#%"

    zmq_msg_init_size_exn

    Synopsis

    fun
    zmq_msg_init_size_exn (msg: &zmqmsg? >> _, n: size_t): void

    Description

    This function is the exit version of zmq_msg_init_size.

    zmq_msg_init_data

    Synopsis

    fun
    zmq_msg_init_data
    (
      msg: &zmqmsg? >> opt (zmqmsg, i==0)
    , data: ptr, size: size_t, ffn: zmq_free_fn, hint: ptr
    ) : #[i:int | i <= 0] int (i) = "mac#%"

    zmq_msg_init_data_exn

    Synopsis

    fun
    zmq_msg_init_data_exn
    (
      msg: &zmqmsg? >> _
    , data: ptr, size: size_t, ffn: zmq_free_fn, hint: ptr
    ) : void // end of [zmq_msg_init_data_exn]

    Description

    This function is the exit version of zmq_msg_init_data.

    zmq_msg_close

    Synopsis

    fun zmq_msg_close
    (
      msg: &zmqmsg >> opt(zmqmsg, i < 0)
    ) : #[i:int | i <= 0] int (i) = "mac#%"

    Description

    This function releases the resource held in a zmq-message.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_msg_close_exn

    Synopsis

    fun zmq_msg_close_exn (msg: &zmqmsg >> _?): void

    Description

    This function is the exit version of zmq_msg_close.

    zmq_msg_copy

    Synopsis

    fun
    zmq_msg_copy
      (dst: &zmqmsg >> _, src: &zmqmsg): interr = "mac#%"

    zmq_msg_copy_exn

    Synopsis

    fun
    zmq_msg_copy_exn (dst: &zmqmsg >> _, src: &zmqmsg): void

    Description

    This function is the exit version of zmq_msg_copy.

    zmq_msg_move

    Synopsis

    fun zmq_msg_move
      (dst: &zmqmsg >> _, src: &zmqmsg): interr = "mac#%"

    zmq_msg_move_exn

    Synopsis

    fun zmq_msg_move_exn (dst: &zmqmsg >> _, src: &zmqmsg): void

    Description

    This function is the exit version of zmq_msg_move.

    zmq_msg_send

    Synopsis

    fun zmq_msg_send (
      msg: &zmqmsg, sock: !zmqsock1, flags: int
    ) : interr = "mac#%" // endfun

    Description

    This function sends a massage part from a given socket and returns the number of bytes of the massage sent if successful or -1 instead.

    zmq_msg_send_exn

    Synopsis

    fun zmq_msg_send_exn
      (msg: &zmqmsg, sock: !zmqsock1, flags: int): intGte(0)

    Description

    This function is the exit version of zmq_msg_send.

    Return Value

    The function returns a nonnegative integer indicating the size of the sent message.

    zmq_msg_recv

    Synopsis

    fun
    zmq_msg_recv
    (
      msg: &zmqmsg >> _, sock: !zmqsock1, flags: int
    ) : interr = "mac#%" // endfun

    Description

    This function recieves a massage part from a given socket and returns the number of bytes of the received massage if successful or -1 instead.

    zmq_msg_recv_exn

    Synopsis

    fun
    zmq_msg_recv_exn
    (
      msg: &zmqmsg >> _, sock: !zmqsock1, flags: int
    ) : intGte(0) // end of [zmq_msg_recv_exn]

    Description

    This function is the exit version of zmq_msg_recv.

    Return Value

    The function returns a nonnegative integer indicating the size of the received message.

    zmq_term

    Synopsis

    fun
    zmq_term
      {l:agz}
    (
      ctx: !zmqctx (l) >> zmqctxopt (l, i < 0)
    ) : #[i:int | i <= 0] int (i) = "mac#%"

    Description

    This function terminates a given zmq-context. Note that it has been deprecated, and zmq_ctx_destroy should be called instead.

    Return Value

    The function returns 0 if successful, or it returns -1.

    zmq_term_exn

    Synopsis

    fun zmq_term_exn (ctx: zmqctx1): void

    Description

    This function is the exit version of zmq_term.

    zmq_sendmsg

    Synopsis

    fun
    zmq_sendmsg
    (
      sock: !zmqsock1, msg: &zmqmsg, flags: int
    ) : interr = "mac#%" // endfun

    Description

    This function is identical to zmq_msg_send except its first two arguments being given in the opposite order. It has been deprecated.

    zmq_recvmsg

    Synopsis

    fun
    zmq_recvmsg
    (
      sock: !zmqsock1, msg: &zmqmsg >> _, flags: int
    ) : interr = "mac#%" // endfun

    Description

    This function is identical to zmq_msg_recv except its first two arguments being given in the opposite order. It has been deprecated.
    This page is created with ATS by Hongwei Xi and also maintained by Hongwei Xi. SourceForge.net Logo