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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:07:59+00:00 2026-05-21T04:07:59+00:00

So, I have an application that communicates with a server quite frequently. I have

  • 0

So, I have an application that communicates with a server quite frequently. I have the Socket creation done in a singleton class, to ensure that the work to create it is only done once. However, this is an Android application, and I can never guarantee that the code that cleans up when the application is destroyed will be executed. Therefore, I am currently opening and closing the socket every time I use it.

I have no idea how cpu intensive this is though, can anyone shed some light?

  • 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-21T04:07:59+00:00Added an answer on May 21, 2026 at 4:07 am

    @providence, if it is a single application which opens/closes the sockets everytime it is used, from a CPU workload standpoint, it is not something I’d worry too much about. If you have an option of keeping the socket open, they might actually be a better thing to do. Mobile data connection options s.a. GPRS, EDGE, 3G-UMTS etc., have optimizations built-in, which relinquish wireless network bandwidth when not in use, and may even enter low-power state. Only when there is some data to be received or sent, does the phone come back to it’s operating-power mode, and allocated wireless resources to the socket. All that your dormant socket is doing is consuming some memory.

    PS> Having no first hand experience in doing network programming (directly at socket level) on Android, much of what I wrote is based on knowledge of wireless network technology, and general unix socket communication fundamentals :-).

    Only if you like my answer, and find it useful feel free to vote it up.

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

Sidebar

Related Questions

We have application that involves C++ socket server, Flash client that communicates with C++
I have a class that communicates with a server (let's call it 'Downloader'). Sometimes,
I have a client application that communicates with a server. In this application the
I have an Android application that connects and communicates with a server. Originally the
I have a C# client server application that communicates using xml documents. The server
I have an application that communicates to server. I want my application to READ
I have a client/server application that communicates with .Net remoting. I need my clients
I am writing an application that communicates using sockets. I have a server running
I'm using Java to create a client/server application that communicates using TCP. The network
I have a web application that communicates with SQL server. Rather than hard-coding all

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.