Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6732421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:38:56+00:00 2026-05-26T10:38:56+00:00

I am working on a chat client app that connects to a chat server.

  • 0

I am working on a chat client app that connects to a chat server. When I receive any pop-up notifications (for example, a SMS message), the iPhone puts the app into the inactive state – great. The problem I have encountered is that once the notification is dismissed, the app has lost all network connections. I’ve read other places that this shouldn’t happen, but I’m not sure what I’m missing!

Here is a snippet of the code I am using to create the read and write streams.

- (void) initNetworkCommunication {

//set up read and write streams
CFReadStreamRef readStream;
CFWriteStreamRef writeStream;

//connect to host at this address and this port
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"somewebsite.org", 3333, &readStream, &writeStream);

//open socket connection
inputStream = [(NSInputStream *)readStream retain];
outputStream = [(NSOutputStream *)writeStream retain];
[inputStream setDelegate:self];
[outputStream setDelegate:self];
[inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[inputStream open];
[outputStream open];
}

Network connection is also lost when the app is sent to the background. I would like to fix that too, but the main issue right now is the pop-up notifications disconnecting the user.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:38:56+00:00Added an answer on May 26, 2026 at 10:38 am

    What are you doing in your application’s “applicationWillResignActive:” method? You might consider suspending the connection, then resuming on it once the app is active again. Either way you should be doing something in that method.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm working on this site web app that should let users easily chat
i have a java chat server & client, that works fine. I made a
Not really that familiar with Swing, and am writing a client-server UDP chat application.
http://www.boost.org/doc/libs/1_46_0/doc/html/boost_asio/example/chat/chat_client.cpp I am working on client application based on he example above. I wanted
I am working on a mini-project which consists of doing a client-server chat application.
For an iPhone chat app I'm working on, I want to know how to
I am working on a C# chat client that needs to have a sending
I'm working on chat application. The underlying server uses Node.js and the client/server communication
I have been working on a (relatively) simple tcp client/server chat program for my
I'm working on a website that has a chat for a client, however, we're

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.