jdiehl / async-network

Cocoa and iOS Socket Networking Evolved
http://jdiehl.github.com/async-network
MIT License
91 stars 31 forks source link

AysncServer's sendCommand Does Not Work in AsyncNetworkIOS.framework #4

Closed willSapgreen closed 9 years ago

willSapgreen commented 9 years ago

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.

jdiehl commented 9 years ago

It works like a charm for me. Even when replacing the sendObject: call with sendCommand: and reporting the command in the server output, it still works. I am guessing the error lies somewhere else. Please provide some more insights so we can get to the bottom of this:

willSapgreen commented 9 years ago

Hello Jonathan, Thanks for the quick response. Do you use Mac framework or IOS framework to test the server side? Mac framework works on my side too but not IOS framework. However, I may miss something in my implementation. So I will do more experiment and give you an update.

Thank you so much for helping.

On Wed, Mar 25, 2015 at 2:44 PM, Jonathan Diehl notifications@github.com wrote:

It works like a charm for me. Even when replacing the sendObject: call with sendCommand: and reporting the command in the server output, it still works. I am guessing the error lies somewhere else. Please provide some more insights so we can get to the bottom of this:

  • Are you including the source files or the framework?
  • Did you run the make file to build the framework or did you compile it by hand?
  • Can you post the lines that touch the framework?

— Reply to this email directly or view it on GitHub https://github.com/jdiehl/async-network/issues/4#issuecomment-86227982.

willSapgreen commented 9 years ago

Hello Jonathan, it turns out I made a silly mistake. In the AsyncClient delegate, I only implement

but the server side uses sendCommand:object.

After implementing - (void)client:(AsyncClient )theClient didReceiveCommand:(AsyncCommand)command object:(id)object connection:(AsyncConnection )connection;

the AsyncClient's delegate can receive the command and object.

Thank you so much for helping.