[rabbitmq-discuss] rabbmitmq - app hangs while calling login user method...
Tim Watson
watson.timothy at gmail.com
Sat May 25 19:05:22 BST 2013
Is the broker running on the host and port you're connecting to?
Have you tried contacting the author of this library?
On 25 May 2013, at 09:55, shivang vyas <shivangvyas2008 at gmail.com> wrote:
> using this library for ios rabbitmq client integration: https://github.com/bimawa/librabbitmq-objC
>
> here is an iOS - obj C code:
>
> }
>
> -(void)establish{
>
>
>
> AMQPConnection *connection = [[AMQPConnection alloc] init];
>
> NSError *error, *error1,*error2,*error3;
>
> [connection connectToHost:<hostname> onPort:<portno> error:&error] ? NSLog(@"Connected to host"):NSLog(@"not connected to host");
>
>
>
> [connection loginAsUser:@"guest" withPasswort:@"guest"
>
> onVHost:@"/" error:&error1];
>
>
>
> AMQPChannel *channel = [connection openChannel];
>
> AMQPExchange * exchange = [[AMQPExchange alloc] initExchangeWithName:<exchangename>
>
> onChannel:channel];
>
>
>
> AMQPQueue *queue = [[AMQPQueue alloc] initWithName:@"my_queue" onChannel:channel];
>
> [queue bindToExchange:exchange withKey:@"99999" error:&error3];
>
>
>
> AMQPConsumer *consumer = [[AMQPConsumer alloc] initForQueue:queue onChannel:&channel
>
> useAcknowledgements:YES
>
> isExclusive:NO
>
> receiveLocalMessages:NO
>
> error:&error2
>
> deepLoop:5];
>
> AMQPConsumerThread *consumerThread = [[AMQPConsumerThread alloc] initWithConsumer:consumer delegate:(id)self nameThread:@"shivng_thread"];
>
> [consumerThread start];
>
>
>
>
>
>
>
> }
>
>
>
> -(void)amqpConsumerThreadReceivedNewMessage:(AMQPMessage*)theMessage{
>
> NSLog(@"message = %@", theMessage);
>
> NSLog(@"message.body = %@", theMessage.body);
>
> }
>
> -(void)amqpConsumerThreadLoseConnection{
>
> NSLog(@"Consumer thread lost connection");
>
> }
>
> application just got hanged while calling :
>
> [connection loginAsUser:@"guest" withPasswort:@"guest"
>
> onVHost:@"/" error:&error1];
>
>
>
> the reason is, function:
>
> result = recv(state->sockfd, state->sock_inbound_buffer.bytes,state->sock_inbound_buffer.len, 0);
>
> doesn't return back, just waiting waiting......
>
> app waiting for executing next other statements after the above line...
>
>
>
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130525/0696a7be/attachment.htm>
More information about the rabbitmq-discuss
mailing list