[zeromq-dev] Resource Temporarily Unavailable

Jeyamahesan Chandrakanthan jeyamahesan.c at gmail.com
Thu Nov 15 18:19:29 CET 2012


Hi All,

Im using the iOS ZMQ framework.....

for receiving the data I'm using the below code

- (void)readSubUpdateFromSocket:(ZMQSocket*)socket

{

    @autoreleasepool {

        NSParameterAssert(! [NSThread isMainThread]);

        while (! [[NSThread currentThread] isCancelled])

        {

            NSData *msg = [socket receiveDataWithFlags:1];

            NSString *msgString = [[NSString alloc] initWithData:msg
encoding:NSUTF8StringEncoding];

            dispatch_async(dispatch_get_main_queue(), ^{

                [self showSubUpdate:msgString];

            });

        }

    }

}


- (NSData *)receiveDataWithFlags:(ZMQMessageReceiveFlags)flags {

zmq_msg_t msg;

int err = zmq_msg_init(&msg);

if (err) {

ZMQLogError(self, @"zmq_msg_init");

return nil;

}


 err = zmq_recv(self.socket, &msg, flags);

if (err) {

ZMQLogError(self, @"zmq_recv");

err = zmq_msg_close(&msg);

if (err) {

ZMQLogError(self, @"zmq_msg_close");

}

return nil;

}


 size_t length = zmq_msg_size(&msg);

NSData *data = [NSData dataWithBytes:zmq_msg_data(&msg) length:length];


 err = zmq_msg_close(&msg);

if (err) {

ZMQLogError(self, @"zmq_msg_close");

/* fall through */

}

return data;

}

im not receiving the data..instead of I'm receiving this below error...

it throws exception: zmq_recv: Resource temporarily unavailable


please help me to move forward.

Regards,
Jeyamahesan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121115/e84ea7af/attachment.htm>


More information about the zeromq-dev mailing list