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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:13:25+00:00 2026-05-25T10:13:25+00:00

I am developing a mobile application that transmit date using TCP protocol ( sockets

  • 0

I am developing a mobile application that transmit date using TCP protocol ( sockets ).
What is the perfect solution ? is to open socket and send message, and if I wan to send another message I need to repeat the same sequence, open>send>close ?
OR, open>send>..keep the socket open..>send again>..>close ??

If I want to implements chat service such as instant messages , is it good to close the socket after each message , as the traffic is a big consideration ?

I hope the question is clear

  • 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-25T10:13:25+00:00Added an answer on May 25, 2026 at 10:13 am

    It depends on the frequency of your messages being sent through the wire. If you plan to send one message every second or two, you should keep the connection open. This is how XMPP protocol works – by streaming XML one piece at a time via open TCP connection.

    Keeping your connection open has two advantages: first establishing a connection comes with a price. Secondly, due to TCP/IP slow-start feature opening and closing the connection will never allow you to use close to full network bandwidth.

    On the other hand if you keep the connection for too long and without any socket traffic, some network middleware like routers or firewalls might close your connection assuming it is dead. You have to consider this and either use keep-alive features or handle reconnects decently.

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

Sidebar

Related Questions

I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose
I am developing an application using Windows Mobile 5.0, under embedded VC++ 4.0, and
I am developing an mobile application that search the user's location via GPS and
I am developing a mobile application that is to run on a Windows Mobile
I'm developing a mobile phone application that targets a lot of mobile devices based
I'm developing a Windows Mobile application that uses Bing Maps Web Service to show
I'm developing a Windows Mobile WinForm application that uses Sql Server CE 3.1 with
I'm developing a Win32 mobile application (.NET CF 2.0/3.5) that has to communicate with
I am developing a mobile application for Windows Mobile. I would like that the
I am developing windows mobile application. I am using the SQLlite database. I am

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.