SORU
2 Mart 2009, PAZARTESİ


Boost IP adres::*::ip::tcp::yuva?

C sunucusu * kütüphane Boost kullanarak yazıyorum. İstemci IP dize gösterimini benim server gösterilmeye almak istiyorum kayıtları. Herkes bunu nasıl biliyor mu?

CEVAP
2 Mart 2009, PAZARTESİ


Yuva uzak bitiş noktası alır, bir işlevi vardır. Komutları (uzun-ish) bu zincirin bir dize almak gerekir git gösterimi uzak bitiş IP adresi verirdim:

asio::ip::tcp::socket socket(io_service);
// Do all your accepting and other stuff here.

asio::ip::tcp::endpoint remote_ep = socket.remote_endpoint();
asio::ip::address remote_ad = remote_ep.address();
std::string s = remote_ad.to_string();

ya oyunu sürüm:

asio::ip::tcp::socket socket(io_service);
// Do all your accepting and other stuff here.

std::string s = socket.remote_endpoint().address().to_string();

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Ash100HD

    Ash100HD

    29 EKİM 2011
  • Make:

    Make:

    23 Mart 2006
  • Within Temptation

    Within Tempt

    18 EYLÜL 2006