Skip to content

Commit 7d16df8

Browse files
committed
Updated client comments.
1 parent 65f35a5 commit 7d16df8

File tree

10 files changed

+160
-86
lines changed

10 files changed

+160
-86
lines changed

boost/network/auth/sasl.hpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) Glyn Matthews 2010.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
7+
#ifndef __BOOST_NETWORK_AUTH_SASL_INC__
8+
# define __BOOST_NETWORK_AUTH_SASL_INC__
9+
10+
11+
# include <boost/network/traits/string.hpp>
12+
13+
14+
namespace boost {
15+
namespace network {
16+
namespace auth {
17+
template <
18+
class Tag
19+
>
20+
class basic_sasl {
21+
22+
public:
23+
24+
// basic_sasl(PLAIN);
25+
26+
// basic_sasl(DIGEST);
27+
28+
};
29+
} // namespace auth
30+
} // namespace network
31+
} // namespace boost
32+
33+
34+
#endif // __BOOST_NETWORK_AUTH_SASL_INC__

boost/network/protocol/xmpp/client.hpp

Lines changed: 89 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class basic_client : boost::noncopyable {
2828

2929
typedef typename string<Tag>::type string_type;
3030

31-
typedef basic_message<Tag> message;
32-
typedef basic_presence<Tag> presence;
33-
typedef basic_iq<Tag> iq;
31+
typedef basic_message<Tag> message_type;
32+
typedef basic_presence<Tag> presence_type;
33+
typedef basic_iq<Tag> iq_type;
3434

3535
explicit basic_client(Handler handler);
3636

@@ -52,30 +52,108 @@ class basic_client : boost::noncopyable {
5252

5353
string_type jid() const;
5454

55-
string_type bound_jid() const;
56-
5755
private:
5856

57+
void handle_stream_start();
58+
void handle_stream_stanza();
59+
void handle_stream_end();
60+
5961
// tcp socket
6062
// tls
6163
// sasl
6264

63-
// parameters, such as jid, bound_jid, domain, port etc.
65+
// parameters, such as jid, domain, port etc.
66+
string_type jid_;
6467

6568
// io_service
69+
boost::asio::io_service io_service_;
6670

6771
// xml parser
6872

69-
// event handler
73+
Handler handler_;
74+
75+
};
7076

71-
// stream open handler
7277

73-
// connection event handlers
78+
template <
79+
class Tag,
80+
class Handler
81+
>
82+
basic_client<Tag, Hander>::basic_client(Handler handler) {
83+
// set the handlers
84+
}
85+
86+
template <
87+
class Tag,
88+
class Handler
89+
>
90+
basic_client<Tag, Hander>::~basic_client() {
7491

75-
Handler handler_;
92+
}
7693

77-
};
94+
template <
95+
class Tag,
96+
class Handler
97+
>
98+
void basic_client<Tag, Hander>::connect(const string_type &proxy_host,
99+
const string_type &proxy_port) {
100+
// get the JID domain
101+
// default port is 52222
102+
// open socket
103+
// socket has a state
104+
// signal connection handler
105+
}
106+
107+
template <
108+
class Tag,
109+
class Handler
110+
>
111+
void basic_client<Tag, Hander>::disconnect() {
112+
// close socket
113+
// signal connection handler
114+
}
115+
116+
template <
117+
class Tag,
118+
class Handler
119+
>
120+
void basic_client<Tag, Hander>::authenticate(const string_type &jid,
121+
const string_type &password) {
122+
123+
}
124+
125+
template <
126+
class Tag,
127+
class Handler
128+
>
129+
void basic_client<Tag, Hander>::send_message(const message_type &message) {
130+
131+
}
132+
133+
template <
134+
class Tag,
135+
class Handler
136+
>
137+
void basic_client<Tag, Hander>::send_presence(const presence_type &presence) {
138+
139+
}
78140

141+
template <
142+
class Tag,
143+
class Handler
144+
>
145+
void basic_client<Tag, Hander>::send_iq(const iq_type &iq) {
146+
147+
}
148+
149+
template <
150+
class Tag,
151+
class Handler
152+
>
153+
basic_client<Tag, Handler>::string_type
154+
basic_client<Tag, Hander>::jid() const {
155+
return jid_;
156+
}
79157

80158

81159
template <

boost/network/protocol/xmpp/element.hpp

Lines changed: 0 additions & 14 deletions
This file was deleted.

boost/network/protocol/xmpp/element_io.hpp

Lines changed: 0 additions & 14 deletions
This file was deleted.

boost/network/tls/tls.hpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Glyn Matthews 2010.
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
7+
#ifndef __BOOST_NETWORK_TLS_TLS_INC__
8+
# define __BOOST_NETWORK_TLS_TLS_INC__
9+
10+
11+
namespace boost {
12+
namespace network {
13+
class tls {
14+
public:
15+
16+
// credentials
17+
// start
18+
// read
19+
// write
20+
21+
};
22+
} // namespace network
23+
} // namespace boost
24+
25+
26+
#endif // __BOOST_NETWORK_TLS_TLS_INC__

libs/network/test/xmpp/xmpp_iq_tests.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@
1010

1111

1212
namespace xmpp = boost::network::xmpp;
13-
using boost::network::xmpp::iq;
1413

1514

1615
BOOST_AUTO_TEST_CASE(xmpp_iq_source_directive_test) {
17-
iq instance;
16+
xmpp::iq instance;
1817
instance << boost::network::source("source@example.com");
1918
BOOST_CHECK_EQUAL("source@example.com", boost::network::source(instance));
2019
}
2120

2221

2322
BOOST_AUTO_TEST_CASE(xmpp_iq_destination_directive_test) {
24-
iq instance;
23+
xmpp::iq instance;
2524
instance << boost::network::destination("dest@example.com");
2625
BOOST_CHECK_EQUAL("dest@example.com", boost::network::destination(instance));
2726
}

libs/network/test/xmpp/xmpp_message_tests.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,48 @@
1010

1111

1212
namespace xmpp = boost::network::xmpp;
13-
using boost::network::xmpp::message;
1413

1514

1615
BOOST_AUTO_TEST_CASE(xmpp_message_source_directive_test) {
17-
message instance;
16+
xmpp::message instance;
1817
instance << boost::network::source("source@example.com");
1918
BOOST_CHECK_EQUAL("source@example.com", boost::network::source(instance));
2019
}
2120

2221

2322
BOOST_AUTO_TEST_CASE(xmpp_message_destination_directive_test) {
24-
message instance;
23+
xmpp::message instance;
2524
instance << boost::network::destination("dest@example.com");
2625
BOOST_CHECK_EQUAL("dest@example.com", boost::network::destination(instance));
2726
}
2827

2928

3029
BOOST_AUTO_TEST_CASE(xmpp_message_header_directive_test) {
31-
message instance;
30+
xmpp::message instance;
3231
instance << boost::network::header("type", "chat");
3332
BOOST_CHECK_EQUAL(1, boost::network::headers(instance).count("type"));
34-
boost::network::headers_range<message>::type range
33+
boost::network::headers_range<xmpp::message>::type range
3534
= boost::network::headers(instance)["type"];
3635
BOOST_CHECK (boost::begin(range) != boost::end(range));
3736
}
3837

3938

4039
BOOST_AUTO_TEST_CASE(xmpp_message_body_directive_test) {
41-
message instance;
40+
xmpp::message instance;
4241
instance << boost::network::header("type", "chat")
4342
<< boost::network::body("Hello world!");
4443
}
4544

4645

4746
BOOST_AUTO_TEST_CASE(xmpp_message_type_accessor_test) {
48-
message instance;
47+
xmpp::message instance;
4948
instance.set_type("chat");
5049
BOOST_CHECK_EQUAL("chat", instance.type());
5150
}
5251

5352

5453
BOOST_AUTO_TEST_CASE(xmpp_message_id_accessor_test) {
55-
message instance;
54+
xmpp::message instance;
5655
instance.set_id("t2w4qax3");
5756
BOOST_CHECK_EQUAL("t2w4qax3", instance.id());
5857
}

libs/network/test/xmpp/xmpp_presence_tests.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,17 @@
1010

1111

1212
namespace xmpp = boost::network::xmpp;
13-
using boost::network::xmpp::presence;
1413

1514

1615
BOOST_AUTO_TEST_CASE(xmpp_presence_source_directive_test) {
17-
presence instance;
16+
xmpp::presence instance;
1817
instance << boost::network::source("source@example.com");
1918
BOOST_CHECK_EQUAL("source@example.com", boost::network::source(instance));
2019
}
2120

2221

2322
BOOST_AUTO_TEST_CASE(xmpp_presence_destination_directive_test) {
24-
presence instance;
23+
xmpp::presence instance;
2524
instance << boost::network::destination("dest@example.com");
2625
BOOST_CHECK_EQUAL("dest@example.com", boost::network::destination(instance));
2726
}

libs/network/test/xmpp/xmpp_stanza_tests.cpp

Lines changed: 0 additions & 10 deletions
This file was deleted.

libs/network/test/xmpp/xmpp_uri_tests.cpp

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)