Binding boost asio to local tcp endpoint

后端 未结 1 663
不知归路
不知归路 2021-01-14 05:46

I\'m trying to bind a boost asio tcp socket to a local network interface specifically. When is the correct time to call the bind() method on the socket?

相关标签:
1条回答
  • 2021-01-14 06:27

    Looks like there isn't enough information. But generally, you should:

    _socket->open()

    _socket->set_option()

    _socket->bind()

    _socket->async_connect()

    in handleConnect(): _socket->async_read_some()

    0 讨论(0)
提交回复
热议问题