profmaad / librabbitmq-objc Goto Github PK
View Code? Open in Web Editor NEWObjective-C wrapper for librabbitmq-c
License: GNU Lesser General Public License v3.0
Objective-C wrapper for librabbitmq-c
License: GNU Lesser General Public License v3.0
in AMQPConsumer change all of your
result = amqp_simple_wait_frame(channel.connection.internalConnection, &frame);
if(result <= 0) { return nil; }
to
result = amqp_simple_wait_frame(channel.connection.internalConnection, &frame);
if(result < 0) { return nil; }
i wasted 3 days using this wrapper thinking i was doing something wrong when it turned out the result have to be < 0 to be wrong, you have that condition wrong
hi:
when i used the librabbitmq send message and receive, once when i back the app background,and change the network form 3g to wifi, and then go back to the app then send a message to MQ server,the app was crash by this time ,how can i resolve it ?
Thank you.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254
I get this error when call [connection connectToHost:myHost onPort:myPort];
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
fcntl$UNIX2003 called from function amqp_open_socket_noblock in image MyProgect.
It's on both rabbitmq-c libraries 0.4.0 and 0.5.0
Do you have any idea why?
I just added the librabbitmq-objc framework into my xcode project. I am currently getting an error lexical or preprocessor issues cocoa/cocoa.h file not found
I would need someone to help me find the cocoa.h file.
Thanks
hi :) its me again hehe
thank you for the other fix, i have a new one for large message sizes
again in the file AMQPConsumer.m, lines +- 109
(currently)
receivedBytes += frame.payload.body_fragment.len;
memcpy(body.bytes, frame.payload.body_fragment.bytes, frame.payload.body_fragment.len);
(new code)
void *body_ptr = (char *)body.bytes + receivedBytes;
memcpy(body_ptr, frame.payload.body_fragment.bytes, frame.payload.body_fragment.len);
receivedBytes += frame.payload.body_fragment.len;
change the way you append the bytes to the structure, that memcpy is only overlapping and when you get (what happened to me) a huge size message, you get just a chunk of the message, that will fix it
:)
The current version of librabbitmq-objc does not support latest versions of rabbitmq-c (https://github.com/alanxz/rabbitmq-c/releases): 0.5.0, 0.4.1 and maybe also previous ones.
My fork of librabbitmq-objc (https://github.com/albertodebortoli/librabbitmq-objc) contains an Xcode project using rabbitmq-c 0.5.0 and it crashes with a single line of code:
AMQPConnection *conn = [[AMQPConnection alloc] init];
When the AMQPConnection object is deallocated
[self disconnect];
in the dealloc method crashes the app. I think the problem relies in socketFD
that is 0.
Even calling
- (void)connectToHost:(NSString*)host onPort:(int)port
right after the creation of the object doesn't help.
rabbitmq-c static library has been built for all the architectures using the script at https://github.com/albertodebortoli/librabbitmq-objc/blob/master/rabbitmq-c/build-scripts/build-static-library.sh
The Xcode project uses CocoaPods to install librabbitmq-objc v1.0.0 (tag created on my fork) and the podspec is hosted in my CocoaPods repository at https://github.com/albertodebortoli/adbcocoapodsrepository.
With CocoaPods installed, the repo che be added as described here http://guides.cocoapods.org/making/private-cocoapods.html
basically:
$ pod repo add ADBCocoaPodsRepository https://github.com/albertodebortoli/adbcocoapodsrepository
the stack trace of the crash is
* thread #1: tid = 0x295b8, 0x01d0a952 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread, stop reason = signal SIGABRT
frame #0: 0x01d0a952 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x01dfc167 libsystem_pthread.dylib`pthread_kill + 101
frame #2: 0x0196ad8b libsystem_sim_c.dylib`abort + 140
frame #3: 0x0194ca96 libsystem_sim_c.dylib`__assert_rtn + 267
frame #4: 0x0000995c librabbitmq-objc-demo`amqp_socket_send(self=<unavailable>, buf=<unavailable>, len=<unavailable>) + 76 at amqp_socket.c:200
frame #5: 0x00003eb1 librabbitmq-objc-demo`amqp_send_frame(state=<unavailable>, frame=<unavailable>) + 337 at amqp_connection.c:508
frame #6: 0x0000b0e3 librabbitmq-objc-demo`amqp_simple_rpc [inlined] amqp_send_method(decoded=<unavailable>, id=<unavailable>, channel=0, state=0x0762a990) + 48 at amqp_socket.c:947
frame #7: 0x0000b0b3 librabbitmq-objc-demo`amqp_simple_rpc(state=0x0762a990, channel=0, request_id=655410, expected_reply_ids=0x0762a990, decoded_request_method=0xbfffd9d8) + 3 at amqp_socket.c:972
frame #8: 0x00003408 librabbitmq-objc-demo`amqp_connection_close(state=0x0762a990, code=200) + 152 at amqp_api.c:285
frame #9: 0x0000d5a9 librabbitmq-objc-demo`-[AMQPConnection disconnect](self=0x0762a830, _cmd=0x0416c975) + 73 at AMQPConnection.m:73
frame #10: 0x0000d271 librabbitmq-objc-demo`-[AMQPConnection dealloc](self=0x0762a830, _cmd=0x018feabe) + 49 at AMQPConnection.m:44
frame #11: 0x0116b9ff libobjc.A.dylib`-[NSObject release] + 47
frame #12: 0x0116a0d5 libobjc.A.dylib`objc_release + 69
frame #13: 0x0116afda libobjc.A.dylib`objc_storeStrong + 39
frame #14: 0x00002c82 librabbitmq-objc-demo`-[AppDelegate application:didFinishLaunchingWithOptions:](self=0x075318b0, _cmd=0x0085bc21, application=0x075302e0, launchOptions=0x00000000) + 658 at CTXAppDelegate.m:29
frame #15: 0x002c2157 UIKit`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 266
frame #16: 0x002c2747 UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1248
frame #17: 0x002c394b UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805
frame #18: 0x002d4cb5 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1022
frame #19: 0x002d5beb UIKit`-[UIApplication sendEvent:] + 85
frame #20: 0x002c7698 UIKit`_UIApplicationHandleEvent + 9874
frame #21: 0x025b0df9 GraphicsServices`_PurpleEventCallback + 339
frame #22: 0x025b0ad0 GraphicsServices`PurpleEventCallback + 46
frame #23: 0x012a7bf5 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
frame #24: 0x012a7962 CoreFoundation`__CFRunLoopDoSource1 + 146
frame #25: 0x012d8bb6 CoreFoundation`__CFRunLoopRun + 2118
frame #26: 0x012d7f44 CoreFoundation`CFRunLoopRunSpecific + 276
frame #27: 0x012d7e1b CoreFoundation`CFRunLoopRunInMode + 123
frame #28: 0x002c317a UIKit`-[UIApplication _run] + 774
frame #29: 0x002c4ffc UIKit`UIApplicationMain + 1211
frame #30: 0x00002fad librabbitmq-objc-demo`main(argc=1, argv=0xbffff0d8) + 141 at main.m:16
could you fix your wrapper library to support recent versions of rabbitmq-c please?
Please change this license to a MPL instead of GPL. That way people can use it in ios apps.
I am a student learning your source . I come from China . My English is poor. so,don't laught at me.
When I want to buid a social app for my iPhone.
I found your source,and use it .
but ,I got some trouble.
You write that require :Cocoa and librabbitmq-c
1:Cocoa whether meaning this source is using in Mac coding?
beacuse my Xcode is warning me . and then I change <"Cocoa/Cocoa.h"> to "<Foundation/Foundation.h>"
2:librabbitmq-c
I don't know why your source have many wrong space in my project and I never change your source any more.
some space even lack parameter.
Xcode wraning that:
file:
AMQPExchange.m
method:
wrong:
amqp_exchange_declare(theChannel.connection.internalConnection, theChannel.internalChannel, amqp_cstring_bytes([theName UTF8String]), amqp_cstring_bytes([theType UTF8String]), passive, durable, autoDelete, AMQP_EMPTY_TABLE);
say that :Toomany arguments to function call,expected 7,have 8.
2:
file
AMQPMessage.h
wrong:
there no unit8 and unit64 ,but Xcode let me change to unit.
and your require Cocoa and librabbitmq - c
I don't know what librabbitmq - c harder I need to include ,because I found many source like that .But never adapt to your source.
Like
https://github.com/ask/rabbitmq-c
please help me . I have been ........
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.