开发者

How to create simple tcp_connect and tcp_write functions?

开发者 https://www.devze.com 2023-01-26 04:06 出处:网络
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 tc

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? (pleas开发者_JAVA百科e provide code, it will be appreciated)

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消