• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: onSocketDidDisconnect in CocoaAsyncSocket
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: onSocketDidDisconnect in CocoaAsyncSocket


  • Subject: Re: onSocketDidDisconnect in CocoaAsyncSocket
  • From: Bing Li <email@hidden>
  • Date: Fri, 29 Apr 2011 19:21:47 +0800

Dear Michael,

"Disgracefully" means the client does not close normally. It might be
crashed or closed by killing the relevant thread or process. I did that by
clicking the red Tasks button in XCode. In this situation, the connection
must not be closed properly with the socket methods.

According to my test, [AsyncSocketDelegate onSocket:
willDisconnectWithError:] is not called either.

I got the sample code from
http://www.macresearch.org/cocoa-scientists-part-xxix-message. I am still a
new developer. I am not sure if the code has any problems.

Thanks so much for your help!

Best regards,
BIng

On Fri, Apr 29, 2011 at 6:56 AM, Michael Dautermann <email@hidden>wrote:

> >
> > I started to use CocoaAsyncSocket to establish TCP connections among
> iPads.
> >
> > I got a problem. According to the references (
> > http://code.google.com/p/cocoaasyncsocket/wiki/Reference_AsyncSocket),
> > onSocketDidDisconnect would be invoked immediately if the connection is
> not
> > already disconnected. I felt confused. What does "not already
> disconnected"
> > mean? I think onSocketDidDisconnect should be called when a connection is
> > disconnected. The description in the reference is wrong?
> >
> > I implemented a server and a client using CocoaAsyncSocket. When closing
> the
> > client disgracefully, I noticed that onSocketDidDisconnect was NOT
> called.
> > Anything wrong with it?
>
> Here are some questions that might help get some further context:
>
> how are you closing the client "disgracefully"?
>
> did the companion [AsyncSocketDelegate onSocket: willDisconnectWithError:]
> method get called?
>
> did you properly set your delegate and define that your object (the one
> that holds your delegate methods) conforms to the delegate protocol in it's
> .h file?
>
>
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >onSocketDidDisconnect in CocoaAsyncSocket (From: Bing Li <email@hidden>)
 >Re: onSocketDidDisconnect in CocoaAsyncSocket (From: Michael Dautermann <email@hidden>)

  • Prev by Date: Re: cpp class keywotd
  • Next by Date: iOS: Data sharing/upgrade
  • Previous by thread: Re: onSocketDidDisconnect in CocoaAsyncSocket
  • Next by thread: Scroll view within scroll view blocks scrolling
  • Index(es):
    • Date
    • Thread