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

  • Home
  • SEARCH
  • 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 3405288
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:29:14+00:00 2026-05-18T05:29:14+00:00

I have to implement an iOS application, which connects to a web server and

  • 0

I have to implement an iOS application, which connects to a web server and receives events from it, i.e. server long polling. I plan to use the AsyncSocket library.

My idea is to open a socket on the iPhone, send it to the server the first time I connect to it, and then listen infinitely to the socket and update the GUI accordingly to the events the server sends to it. Here are my questions:

  1. Is this a correct approach and if not – how it should be done?
  2. Can the server send data to the socket I give to it (as long as the socket is opened), if the iPhone and the server are on different networks, and the iPhone is on a local network?
  • 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-18T05:29:15+00:00Added an answer on May 18, 2026 at 5:29 am
    1. Yes. 2. Yes.

    On the fone, you will get information arriving in to the fone probably something like this:

    -(void)onSocket:(AsyncSocket *)sock didReadData:(NSData*)data withTag:(long)tag
        {
        [data getBytes:&getMe length:sizeof(CommProt)];
        // do not forget to roll in the next read...
        [sock readDataToLength:sizeof(CommProt) withTimeout:-1 tag:0];
        // now parse that command
        }
    

    and on the fone you will send information from the fone quite likely something like this (there are a couple of different approaches)…

    -(void) mySendStringData:(NSString *)sss
        {   
        // so easy, thank goodness for AysncSocket
        NSData* data = [sss dataUsingEncoding: NSASCIIStringEncoding];
    
        [theSocket writeData:data withTimeout:0.5 tag:0];
        [theSocket writeData:quickCR withTimeout:0.5 tag:0];
        // (in the protocol at hand, we are using a delimiter on the end (a CR))
        }
    

    Note. It is possible this post i made could be helpful to you: it gives the lowdown on protocols in iOS:

    Tablet(iPad/Android)-Server Communication Protocol

    I hope it helps.

    Conceivably this could help iPad and Arduino Integration and this secret knowledge could help Client/Server GKSessions Cheers

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

Sidebar

Related Questions

I have a producer/consumers design in my application which implement Produce/Consume functions on user
I have to implement the VinPower application. They offer a Java version, a C
I have implement a small web service using .net 3.5. I have used linq
I have to implement MPI system in a cluster. If anyone here has any
I have to implement a middleware system for file sharing, and it has to
Let's say I have to implement a piece of T-SQL code that must return
Working on a project at the moment and we have to implement soft deletion
For a project I have a specification with formulas, I have to implement. In
I was having a discussion with coworkers. We have to implement some security standards.
Not very technical, but... I have to implement a bad words filter in a

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.