amqp_rpc_reply_t : socket is closed when loggin rabbitmq server

62 views
Skip to first unread message

Jame

unread,
May 26, 2021, 5:52:04 AM5/26/21
to rabbitmq-c-users
Hi All / Mr. Alan
I used example "amqp_sendstring.c" to send the simple word "Hello World" to  my rabbitmq server. And I got the problem when login, it is response "socket is closed".
I used C# code with example "Send.cs" and successed, meaning my server is no problem.
I am sr for my stupidity with C. 
I checked step by step:
//A TCP socket connection. Create a new TCP socket.
socket = amqp_tcp_socket_new(conn);
  if (!socket) {
    die("creating TCP socket");
  }
>> nothing happen here. 

//Open a socket connection.
status = amqp_socket_open(socket, hostname, port);
  if (status) {
    die("opening TCP socket");
  }
>> Result: Displayed : opening TCP socket  in my ternimal
//Login to the broker
die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN,
                               "guest", "guest"),
                    "Logging in");
>> Result: Displayed : Logging in : socket is closed
Seem the program end here. The next step can't be reached.
I am try "google search" but I am still not understand. What's happening? How to solve this problem.
Thank for help!
Regards

Jame

unread,
May 27, 2021, 10:05:59 PM5/27/21
to rabbitmq-c-users

my problem is solved. 
Vào lúc 16:52:04 UTC+7 ngày Thứ Tư, 26 tháng 5, 2021, Jame đã viết:
Reply all
Reply to author
Forward
0 new messages