I need a sample Asio asynchronous client to read&write into sockets and stdin&stdout.

Hello, I am writing a client application that reads and writes data into a remote server. Currently the communication is done using synchronous (blocking) sockets. I am running Ubuntu and using C++. I need to re-write this app so it will asynchronously read & write into sockets and stdin/stdout, I also need to send a heartbeat signal if there wasn't any communication with the server for 60 seconds. I am new to Asio, I went through tutorial and looked at the examples such as asynchronous timer and client chat but they are not all that I need. Could someone point me to a sample Asio application that does what I need. Thank you!

vincegata
Hello,
I am writing a client application that reads and writes data into a remote server. Currently the communication is done using synchronous (blocking) sockets. I am running Ubuntu and using C++.
I need to re-write this app so it will asynchronously read & write into sockets and stdin/stdout, I also need to send a heartbeat signal if there wasn't any communication with the server for 60 seconds. I am new to Asio, I went through tutorial and looked at the examples such as asynchronous timer and client chat but they are not all that I need.
Could someone point me to a sample Asio application that does what I need.
Rather than asking for someone else to write a program that meets your requirements, could you be more specific about what you don't understand pertaining to the asio library? Asynchronous operations have adequate examples as far as I know. Tcp/ip also has adequate examples as far as I know. What's missing? A heartbeat is out of the scope of the library and is a basic thing you should be able to gleam from any networking example on the web or come up with yourself. Writing to stdin/stdout is basic c++ and doesn't have much to do with at all with asio.
participants (2)
-
Christopher
-
vincegata