Thread: Open a serial port asynchronously with boost asio?

  1. #1
    Algorithm engineer
    Join Date
    Jun 2006
    Posts
    286

    Open a serial port asynchronously with boost asio?

    Hi, does anyone know if there is a way to open a boost::asio::serial_port asynchronously? I make a series of attempts trying to open a serial port in a program I have made, but the program freezes for five to ten seconds or something when trying to open a connection. If the connection fails, it will try to open the port again (until it has succeeded) and freeze again for ten seconds or so, and so on.
    Come on, you can do it! b( ~_')

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Add thorough error checking and reporting. Any errors?
    Does it ever open successfully after a delay? Do reads and writes work as expected?

    Use the debugger to "break" during a delay and find where exactly it's occurring.

    gg

  3. #3
    Algorithm engineer
    Join Date
    Jun 2006
    Posts
    286
    I already have error reporting; sometimes I get timeouts from the attempts to open the port. It is the freezing of the program I want to prevent though. It's not a necessity, but it makes it feel better when you run the program.
    Come on, you can do it! b( ~_')

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Serial Port Questions
    By valaris in forum Tech Board
    Replies: 2
    Last Post: 05-22-2009, 08:26 AM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. my serial port data reading program isn't working
    By gnychis in forum C Programming
    Replies: 5
    Last Post: 06-02-2005, 08:40 AM
  4. Need help or info about serial port communication
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 01-08-2002, 01:48 PM
  5. serial port still wont work
    By alcoholic in forum C++ Programming
    Replies: 6
    Last Post: 10-31-2001, 12:51 PM

Tags for this Thread