开发者

Basic question about socket programming using Boost ASIO

I am relatively new to socket programming. I am currently trying examples provided with boost::asio. I have a general question a开发者_高级运维bout sockets.

Lets say I am connecting a remote endpoint using tcp::socket.connect(endpoint,error) function. Can I both send and receive using the same socket object or do I have to create another socket object to send the data?

Thanks, Devendra


Yes, you can both send and recv on the same socket. E.g a typical use of a client socket would be to connect, send some data, read some data, etc depending on the protocol.

A useful link to learn about boost asio would be a free eBook by Boris Schäling: http://en.highscore.de/cpp/boost/index.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜