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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:47:30+00:00 2026-05-16T06:47:30+00:00

The program I’m working on in C# (.Net Framework 2.0) calls for the ability

  • 0

The program I’m working on in C# (.Net Framework 2.0) calls for the ability to switch over to a ‘remote mode’ and send ascii data to another screen via Bluetooth. I’ll start by saying I’m not a very experienced programmer, and I know nothing about networking, but after fooling around with the SerialPort class yesterday I was able to work up a little chat program that worked nicely between two Bluetooth-connected devices.

The chat program, however, only sent data when the user hit a button to “send” data. If the two devices weren’t properly connected I just threw a TimeoutException along with an error message. The program I’m working on now is much larger, and tries to write data constantly so long as it has the COM port open.

That means if the two devices aren’t immediately connected, it has to throw a TimeoutException, and it will continue to throw it, again and again until they ARE properly connected. That’s totally unacceptable. It slows the program down to the point where it isn’t usable, and litters the Debug output with “TimeoutException Thrown Here” error messages.

Is there a better solution for how to do this? Some way that I can get it to only write the data out if I can confirm that the two devices are connected, without constantly checking (and subsequently getting Timeout Errors while checking).

  • 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-16T06:47:31+00:00Added an answer on May 16, 2026 at 6:47 am

    No. A serial connection is stateless.

    This means you don’t know if someone is on the other side. All you can do is sending something out and take a look if something meaningful is coming back.

    The easiest example for this is the good old analog modem. To find out if it is connected is to send out a AT and check if an OK comes back.

    So your solution is the right one, but maybe not properly implemented. You should put your connection built-up sequence into a BackgroundWorker. So these tries will be done in another thread while your GUI stays responsive to the user.

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

Sidebar

Related Questions

The program I'm working on crashes sometimes trying to read data at the address
Program runs once and it both throws data to the pipe and gets it
The program I'm coding now makes a pretty huge list of data items. Now,
The program that I am working on takes a file and parses it line
program reads the following data from a .txt file: f 3.40 f 4.00 m
A program I am working on right now has to generate a file. Is
Program design: Class A, which implements lower level data handling Classes B-E, which provide
My program contains three textfields and I am inserting the data into an sqlite
Program that calculates and shows the value of (2 to the 10th power) This
program to output all 4 digit numbers where no prior digit is greater than

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.