@@ -55,25 +55,26 @@ template <class Tag>
5555struct basic_request :public basic_message <Tag> {
5656
5757mutable boost::network::uri::uri uri_;
58+ unsigned short source_port_;
5859typedef basic_message<Tag> base_type;
5960
6061public:
6162typedef typename sync_only<Tag>::type tag;
6263typedef typename string<tag>::type string_type;
6364typedef boost::uint16_t port_type;
6465
65- explicit basic_request (string_typeconst & uri_) : uri_(uri_) {}
66+ explicit basic_request (string_typeconst & uri_) : uri_(uri_), source_port_( 0 ) {}
6667
67- explicit basic_request (boost::network::uri::uriconst & uri_) : uri_(uri_) {}
68+ explicit basic_request (boost::network::uri::uriconst & uri_) : uri_(uri_), source_port_( 0 ) {}
6869
6970void uri (string_typeconst & new_uri) { uri_ = new_uri; }
7071
7172void uri (boost::network::uri::uriconst & new_uri) { uri_ = new_uri; }
7273
73- basic_request () : base_type() {}
74+ basic_request () : base_type(), source_port_( 0 ) {}
7475
7576basic_request (basic_requestconst & other)
76- : base_type(other), uri_(other.uri_) {}
77+ : base_type(other), uri_(other.uri_), source_port_(other.source_port_) {}
7778
7879 basic_request&operator =(basic_request rhs) {
7980 rhs.swap (*this );
@@ -85,6 +86,7 @@ struct basic_request : public basic_message<Tag> {
8586 basic_request<Tag>&this_ref (*this );
8687 base_ref.swap (this_ref);
8788boost::swap (other.uri_ ,this ->uri_ );
89+ boost::swap (other.source_port_ ,this ->source_port_ );
8890 }
8991
9092 string_typeconst host ()const {return uri_.host (); }
@@ -110,6 +112,10 @@ struct basic_request : public basic_message<Tag> {
110112void uri (string_typeconst & new_uri)const { uri_ = new_uri; }
111113
112114 boost::network::uri::uriconst &uri ()const {return uri_; }
115+
116+ void setSourcePort (const unsigned short port) { source_port_ = port; }
117+
118+ unsigned short getSourcePort ()const {return source_port_; }
113119};
114120
115121/* * This is the implementation of a POD request type