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 6552129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:25:22+00:00 2026-05-25T12:25:22+00:00

I use BSD socket in my app to send and receive data on iphone4(iOS4.1),there

  • 0

I use BSD socket in my app to send and receive data on iphone4(iOS4.1),there are three situations in my app:

  1. app is running in foreground and screen locks, it’s fine.
  2. app is running in background and screen does’t lock, it’s fine too(I use NSStream to send and receive data for keep app alive in background,it works fine.)
  3. app is running in background and screen locks, app running fine but always get the SIGPIPE error when app try to call sendto() or send() through UDP or TCP socket.

I search a lot but get nothing useful,from here i know what SIGPIPE is , and i use setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (void *)&on, sizeof(int)) to avoid app exit abnormally. but i still don’t know why this error occurred only in situation 3 and how to send data normally through bsd socket in this situation.


I have try to renew and reconnect but it does’t work,it still get SIGPIPE error.
I think it maybe that all BSD sockets cannot get internal access in situation 3(As far as we know that BSD socket cannot activate wifi or EDGE connection in iOS),Anyone can help me or give me some suggestions? and sorry for my Broken English^.^,Thank you very much .

  • 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-25T12:25:22+00:00Added an answer on May 25, 2026 at 12:25 pm

    I search on google and found my own question 10 months before, that’s interesting.
    I already had a solution for application keep running in background , and setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (void *)&on, sizeof(int)) is useful which will ignore Sigpipe 13 error .

    this error happens when the socket already lost physical connection and still try to write data,through Wifi, 3G or Accessory.

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

Sidebar

Related Questions

'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
We use a data acquisition card to take readings from a device that increases
I'm writing a client-server app using BSD sockets. It needs to run in the
(I use BSD Sed.) This bash script: sed -E -f parsefile < parsewords.d With
Is there any benefit on Windows to use the WSA winsock functions compared to
I've got a question about use of permissive-licensed (BSD, Apache, MIT, etc) source where
While this question is tagged EventMachine, generic BSD-socket solutions in any language are much
I am currently using the BSD sockets API. I would like to use the
There are a couple of threads talking about license issue. Mostly focusing on GPL/LGPL/BSD.
If, under UNIX/Linux/BSD/OSX, I use this sequence of APIs in Application A: msgq_id =

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.