|
Boost Users : |
Subject: Re: [Boost-users] How to access COM ports
From: Cliff Green (cliffg_at_[hidden])
Date: 2009-01-03 16:18:01
> How to access COM port using BOOST library. I want to access COM3 port using boost.
Use the Asio serial port facilities. COM / serial ports are not TCP streams. Read the Asio reference doc on Serial port facilities (I don't think there's any serial port examples in the docs yet, but there should be people on this or the Asio e-mail list that can help with specific questions).
> Another problem I am facing is that the network client should be platform-independent but if I use socket.h then it will not work on windows and if I use winsock then it will not run on linux/unix variants. Same for other header files like inet.h etc
Don't use them. Everything you need (unless you're doing something very esoteric) is supplied through the Asio facilities.
Are you confusing COM / serial I/O with networking programming? They are two separate and distinct things, although Asio provides an API to handle async events on either.
Cliff
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net