File tree Expand file tree Collapse file tree 4 files changed +35
-3
lines changed
Expand file tree Collapse file tree 4 files changed +35
-3
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,18 @@ namespace sio
165165 }
166166 }
167167
168+ template <typename client_type>
169+ void client_impl<client_type>::set_user_agent(std::string const & ua)
170+ {
171+ m_client.set_user_agent (ua);
172+ }
173+
174+ template <typename client_type>
175+ std::string client_impl<client_type>::get_user_agent()
176+ {
177+ return m_client.get_user_agent ();
178+ }
179+
168180 /* ************************protected:*************************/
169181 template <typename client_type>
170182 void client_impl<client_type>::send(packet& p)
Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ namespace sio
8080 virtual void set_reconnect_delay (unsigned millis)=0;
8181 virtual void set_reconnect_delay_max (unsigned millis)=0;
8282
83+ virtual void set_user_agent (std::string const & ua)=0;
84+ virtual std::string get_user_agent ()=0;
85+
8386 // used by sio::socket
8487 virtual void send (packet& p)=0;
8588 virtual void remove_socket (std::string const & nsp)=0;
@@ -178,6 +181,10 @@ namespace sio
178181 void on_socket_closed (std::string const & nsp);
179182
180183 void on_socket_opened (std::string const & nsp);
184+
185+ void set_user_agent (std::string const & ua);
186+
187+ std::string get_user_agent ();
181188
182189 private:
183190 void run_loop ();
Original file line number Diff line number Diff line change @@ -142,5 +142,14 @@ namespace sio
142142 {
143143 m_impl->set_reconnect_delay_max (millis);
144144 }
145-
145+
146+ std::string client::get_user_agent () const
147+ {
148+ return m_impl->get_user_agent ();
149+ }
150+
151+ void client::set_user_agent (std::string const & ua)
152+ {
153+ m_impl->set_user_agent (ua);
154+ }
146155}
Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ namespace sio
8080 void set_reconnect_delay (unsigned millis);
8181
8282 void set_reconnect_delay_max (unsigned millis);
83+
84+ std::string get_user_agent () const ;
85+
86+ void set_user_agent (std::string const & ua);
8387
8488 sio::socket::ptr const & socket (const std::string& nsp = " " );
8589
@@ -94,8 +98,8 @@ namespace sio
9498
9599 private:
96100 // disable copy constructor and assign operator.
97- client (client const &){}
98- void operator =(client const &){}
101+ client (client const &) = delete ;
102+ void operator =(client const &) = delete ;
99103
100104 std::unique_ptr<client_impl_base> m_impl;
101105 };
You can’t perform that action at this time.
0 commit comments