Rella
Rella

Reputation: 66935

How to create simple tcp_connect and tcp_write functions?

So I need2 functions: 1) tcp_connect that would try to connect to tcp adress (given string like tcp://123.123.123.123:33333/) capable of returning some bool if connection was sucsessfull and simple tcp_write function capable to write a buffer of given langth on to opened connection. So where to get how to do it with boost? (please provide code, it will be appreciated)

btw: how can we input into it normal url like tcp://www.bla-bla.com:port?

Upvotes: 0

Views: 656

Answers (1)

Nim
Nim

Reputation: 33655

boost::asio, and here is the code you need: http://www.boost.org/doc/libs/1_44_0/doc/html/boost_asio/examples.html

Upvotes: 1

Related Questions