• 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: Dead Streams?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dead Streams?


  • Subject: Re: Dead Streams?
  • From: Jeremy Wyld <email@hidden>
  • Date: Tue, 16 Nov 2004 08:42:56 -0800

Since the code is spinning in a do loop just getting bytes from the user, there is no way of getting events or anything from the stream. It is possible that the pipe has been closed down by the server side during the looping. The actual detection of such will not happen until the write is performed.

There is no total control for maintaining the connection. If the server chooses to close you, tough love. If the connection is dropped, you'll have to pay the price to connect. The best way to maintain the connection is to use the event-based api's. Don't perform synchronous reads or writes because they'll only wait for a certain amount of time before assuming the connection is dead.

jeremy

On Nov 16, 2004, at 6:40 AM, Michael Purdy wrote:

I've noticed in the Echo Client example project a comment block
indicating streams can go dead and dead streams will not be realized
until trying to write to it.  I'm confused as to why this would happen.
I guess I'm wondering what would cause a stream to go dead, beyone a
physical network issue.  Is there an issue with the API that does not
allow streams and sockets to remain open?

My app needs to open a socket and keep it opened indefinitely while
data is continually sent back and forth to and from a server.  Is there
a way to reconnect the socket/stream if it goes dead without incurring
much overhead (so as to not affect the real time processing needs of my
app)?

Michael


_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Dead Streams? (From: "Michael Purdy" <email@hidden>)

  • Prev by Date: General Sockets Questions?
  • Next by Date: Re: detecting sockets
  • Previous by thread: Dead Streams?
  • Next by thread: General Sockets Questions?
  • Index(es):
    • Date
    • Thread