Function amqp_open_socket

Synopsis

#include <librabbitmq/amqp.h>

int amqp_open_socket(char const *hostname, int portnumber)

Description

Open a socket to a remote host

Deprecated
This function is deprecated in favor of amqp_socket_open()

Looks up the hostname, then attempts to open a socket to the host using the specified portnumber. It also sets various options on the socket to improve performance and correctness.

Parameters:

[ in ] hostname - this can be a hostname or IP address. Both IPv4 and IPv6 are acceptable

[ in ] portnumber - the port to connect on. RabbitMQ brokers listen on port 5672, and 5671 for SSL

Return
a positive value indicates success and is the sockfd. A negative value (see amqp_status_enum)is returned on failure. Possible error codes:
Note
IPv6 support was added in v0.3
See
amqp_socket_open() amqp_set_sockfd()
Since
v0.1

Source

Lines 310-312 in librabbitmq/amqp_socket.c. Line 1386 in librabbitmq/amqp.h.

int amqp_open_socket(char const *hostname, int portnumber) {
  return amqp_open_socket_inner(hostname, portnumber, amqp_time_infinite());
}





Add Discussion as Guest

Log in to DocsForge