GithubHelp home page GithubHelp logo

jdiehl / async-network Goto Github PK

View Code? Open in Web Editor NEW
91.0 91.0 31.0 3.48 MB

Cocoa and iOS Socket Networking Evolved

Home Page: http://jdiehl.github.com/async-network

License: MIT License

Objective-C 99.65% Shell 0.20% Ruby 0.15%

async-network's People

Contributors

adamcampbell avatar chrisgibbs avatar jdiehl avatar levey avatar lvyzhu avatar readmecritic avatar schemetrical avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

async-network's Issues

AsyncNetwork Framework for iOS architecture x86_64

Hello Jonathan,
Have you tried to build AsyncNetwork framework iOS x86_64 in Xcode 6+?
I modified your setting to generate AsyncNetwork framework for iOS but got

ld warning:
/MyProjectName/AsyncNetwork.framework/AsyncNetwork, missing required architecture x86_64 in file /MyProjectName/AsyncNetwork.framework/AsyncNetwork (2 slices)
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_AsyncClient", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thank you for precious time on my problem.
I will also give you an update if any progress on my side.

Building & Debugging

Hello Jonathan,

I need a little help if possible with two things - running the examples and console debugging

  • In regard to the former, I can successfully build the frameworks. I have installed both frameworks into /Library/Frameworks, but when i try to compile an example in Xcode (such as ClientServer), it fails because 'AsyncNetwork/AsyncNetwork.h' cannot be found. I've restarted Xcode (7.2) and tried re-adding the framework, but must be missing some other setting
  • In regards to debugging, I'd like to enable the debugging that is in CocoAsyncSocket - what would be the best way to enable this and package a framework with debugging enabled. A quick search of sync-network doesn't appear to have any console logging. Is that right?

Thanks
Garry

Feature - Individual sendCommand in AsyncServer and AsyncClient

Hello Jason,

In AsyncServer and AsyncClient, sendCommand method will send object to all connected AsyncConnections.

Is it possible to send object to specific AsyncConnection? For example, the API will look like

  • (void)sendCommand:(AsyncCommand)command
    object:(id)object
    responseBlock:(AsyncNetworkResponseBlock)block
    toConnection:(AsyncConnection*)connection;

With your permission, I can write this method and you can review it.

P.S. I don't know if there is a "Feature" to create in Github. So I use "Issues" instead. Sorry for any inconvenience.

Web Scripting Support

Add a Ruby / PHP / JavaScript script that demonstrates how AsyncNetwork can communicate with backend scripting languages.

111

2232 #bug

AsyncClient Connection Error

When setting autoConnect to TRUE in AsyncClient and start,

  • (void)client:(AsyncClient *)theClient didFailWithError:(NSError *)error will be called.

The error is "Connection refused".

This only happens when the server does not exist.

Is it normal situation?

Thank you.

Bluetooth Support

Hello Jonathan,
It does not work when using AsyncServer and AsyncClient through Bluethooth( it works through WiFi ). Then I found the following links about in order to through Bluetooth, includesPeerToPeer property sets to TRUE on NSNetService(AsyncServer) and NSNetServiceBrowser(AsyncClient). However, after setting this property before AsyncClient start or AsyncServer start, the devices still cannot see each other. Can you take a look if available?

The links:
https://developer.apple.com/library/ios/qa/qa1753/_index.html
https://developer.apple.com/library/ios/documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/PublishingServices.html

Thank you for helping.

'GCDAsyncSocket.h' file not found

Seems CocoaAsyncSocket files are missing. I’ve compiled using the makefile and added the framework to the project folder and Embedded Binaries and Linked Frameworks and Libraries. Running the project results in 'GCDAsyncSocket.h' file not found. Not sure what I’m missing.

Crash in [AsyncClient netServiceBrowser:didFindService:moreComing:]

`
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x1804d5bd0 objc_msgSend + 16

1 pos-offline 0x100980e9c -[AsyncClient
netServiceBrowser:didFindService:moreComing:] (AsyncClient.m:163)
2 CFNetwork 0x181536f00 -[NSNetServiceBrowser _dispatchCallBack:flags:error:] + 784
3 CFNetwork 0x18146400c _BrowseReply(_DNSServiceRef_t*, unsigned int, unsigned int, int, char const*, char const*, char const*, void*) + 576
4 libsystem_dnssd.dylib 0x1809aff14 handle_browse_response + 156
5 libsystem_dnssd.dylib 0x1809ae00c DNSServiceProcessResult + 620
6 CFNetwork 0x181463974 _SocketCallBack(__CFSocket*, unsigned long, __CFData const*, void const*, void*) + 32
7 CoreFoundation 0x180e115b0 __CFSocketPerformV0 + 1096
8 CoreFoundation 0x180e0cefc CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
9 CoreFoundation 0x180e0c910 __CFRunLoopDoSources0 + 412
10 CoreFoundation 0x180e0a690 __CFRunLoopRun + 724
11 CoreFoundation 0x180d39680 CFRunLoopRunSpecific + 384
12 GraphicsServices 0x182248088 GSEventRunModal + 180
13 UIKit 0x185bb0d90 UIApplicationMain + 204

`

This crash stack, I think there maybe a issue of serviceBrowser's delegate

Errors when running make

Output:

=== BUILD TARGET AsyncNetwork OF PROJECT AsyncNetwork WITH THE DEFAULT CONFIGURATION (Release) ===
** BUILD FAILED **

The following build commands failed:
CompileC build/AsyncNetwork.build/Release/AsyncNetwork.build/Objects-normal/x86_64/GCDAsyncSocket.o ThirdParty/CocoaAsyncSocket/GCD/GCDAsyncSocket.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/AsyncNetwork.build/Release/AsyncNetwork.build/Objects-normal/x86_64/GCDAsyncUdpSocket.o ThirdParty/CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

=== BUILD TARGET AsyncNetworkIOS OF PROJECT AsyncNetwork WITH THE DEFAULT CONFIGURATION (Release) ===
** BUILD FAILED **

The following build commands failed:
CompileC build/AsyncNetwork.build/Release-iphoneos/AsyncNetworkIOS.build/Objects-normal/armv7/GCDAsyncUdpSocket.o ThirdParty/CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/AsyncNetwork.build/Release-iphoneos/AsyncNetworkIOS.build/Objects-normal/armv7/GCDAsyncSocket.o ThirdParty/CocoaAsyncSocket/GCD/GCDAsyncSocket.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

=== BUILD TARGET AsyncNetworkIOS OF PROJECT AsyncNetwork WITH THE DEFAULT CONFIGURATION (Release) ===
** BUILD FAILED **

The following build commands failed:
CompileC build/AsyncNetwork.build/Release-iphonesimulator/AsyncNetworkIOS.build/Objects-normal/i386/GCDAsyncSocket.o ThirdParty/CocoaAsyncSocket/GCD/GCDAsyncSocket.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC build/AsyncNetwork.build/Release-iphonesimulator/AsyncNetworkIOS.build/Objects-normal/i386/GCDAsyncUdpSocket.o ThirdParty/CocoaAsyncSocket/GCD/GCDAsyncUdpSocket.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
cp: build/Release/AsyncNetwork.framework/AsyncNetwork: No such file or directory
cp: build/Release/AsyncNetwork.framework/Modules: No such file or directory
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: build/Release-iphoneos/AsyncNetworkIOS.framework/AsyncNetworkIOS (No such file or directory)

AysncServer's sendCommand Does Not Work in AsyncNetworkIOS.framework

Hello Jonathan,
It seems that in AsyncNetworkIOS.framework AsyncServer's sendCommand doesn't work. It sounds weird because in ClientServer example, AsyncNetServer's sendCommand works, which uses AsyncNetwork.framework. Would you mind to confirm this potential issue? At same time I will keep testing and update if any new evidence. Please let me know if any problem. Thank you so much for helping.

How to use without AppDelegate in a command line app?

We are trying to use AsyncNetwork in a native osx node.js module and cannot quite get it to work. Our node.js module does initialize the AsyncServer fine, but then no signals are ever fired..

Would it be possible to have one example without AppDelegate. I quess it would need to initialize the needed runloops and queues so that AsyncNetwork can work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.