Recent Changes

2012-09-21
2012-09-17

Latest File Release

This Project Has Not Released Any Files

Wiki Guide

Side Bar

telnet

ストリーム演算子を使ってtelnetアクセスを行う。

宣言

ヘッダーファイル:roast/net/telnet.hpp

  1. namespace roast
  2. {
  3. template <
  4. typename _SocketT = ::roast::tcp_socket,
  5. typename _Strm = ::roast::stream::socket_stream<true,_SocketT> >
  6. class telnet_ : public _Strm
  7. {
  8. public:
  9. telnet_();
  10. telnet_(const char* host, int port_no);
  11. bool connect(const char* host, int port_no);
  12. };
  13. typedef telnet_<> telnet;
  14. }

使い方

  1. telnet tn("www.google.co.jp",80);
  2. string s;
  3. tn << "GET /index.html HTTP/1.1\r\n\r\n";
  4. tn >> s;

みたいな感じだったような。

ストリームはRoast独特のものなのでstream参照。