login about faq

Hi there,

I recently downloaded the Cocoa objective-c library and am attempting to make a HTTP server but having some struggles.

I want to use the CkoSocketProgress callbacks and strictly use the Async calls and not manage the background thread/event loop myself. When doing this it appears the AsyncAcceptStart method isn't working 100% as the callbacks never get notified of an accept complete.

Here's what my code does:

1) Creates a subclass of CkoSocketProgress that implements all the methods 2) Creates a CkoSocket class 3) Calls setEventCallbackObject: on CkoSocket passing in the previously made CkoSocketProgress instance 4) Calls BindAndListen:backlog on CkoSocket 5) Calls AsyncAcceptStart: with a 0ms timeout 6) Attempt connection to server

I was assuming at this point AcceptComplete on the CkoSocketProgress object would be called, however it never is.

If I instead use the blocking API of AcceptNextConnection: the server successfully accepts the incoming connection and fires the event callback.

Curious if this is the correct way to use the libraries or is actually a bug on my end? It seems odd the non-async methods will fire the callbacks but the async methods wont.

Any help greatly appreciated!

Cheers, Robert

asked Feb 21 '14 at 10:29

robertjpayne's gravatar image

robertjpayne
1111


Apologies for the duplicate, weird signup issue.

link

answered Feb 21 '14 at 10:31

robertjpayne's gravatar image

robertjpayne
1111

Event callbacks will not happen for asynchronous methods running in a background thread. A callback, by definition, is something that happens in the same thread. For example:

App --> calls Chilkat method --> calls back into App ---> app returns control to Chilkat method --> Chilkat method returns control to App

link

answered Feb 24 '14 at 17:11

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×34
×8

Asked: Feb 21 '14 at 10:29

Seen: 1,108 times

Last updated: Feb 24 '14 at 17:11

powered by OSQA