@@ -87,7 +87,8 @@ namespace websockets {
8787 return true ;
8888 }
8989
90- bool WebsocketsClient::connect (WSString url) {
90+ bool WebsocketsClient::connect (WSInterfaceString _url) {
91+ WSString url = internals::fromInterfaceString (_url);
9192 WSString protocol = " " ;
9293 if (doestStartsWith (url, " http://" )) {
9394 protocol = " http" ;
@@ -122,14 +123,18 @@ namespace websockets {
122123 host = onlyHost;
123124 }
124125
125- return connect (host, port, uri);
126+ return this ->connect (
127+ internals::fromInternalString (host),
128+ port,
129+ internals::fromInternalString (uri)
130+ );
126131 }
127132
128- bool WebsocketsClient::connect (WSString host, int port, WSString path) {
129- this ->_connectionOpen = this ->_client .connect (host, port);
133+ bool WebsocketsClient::connect (WSInterfaceString host, int port, WSInterfaceString path) {
134+ this ->_connectionOpen = this ->_client .connect (internals::fromInterfaceString ( host) , port);
130135 if (!this ->_connectionOpen ) return false ;
131136
132- auto handshake = generateHandshake (host, path);
137+ auto handshake = generateHandshake (internals::fromInterfaceString ( host), internals::fromInterfaceString ( path) );
133138 this ->_client .send (handshake.requestStr );
134139
135140 auto head = this ->_client .readLine ();
@@ -193,9 +198,9 @@ namespace websockets {
193198 return WebsocketsEndpoint::recv ();
194199 }
195200
196- bool WebsocketsClient::send (WSString data) {
201+ bool WebsocketsClient::send (WSInterfaceString data) {
197202 if (available ()) {
198- return WebsocketsEndpoint::send (data, MessageType::Text);
203+ return WebsocketsEndpoint::send (internals::fromInterfaceString ( data) , MessageType::Text);
199204 }
200205 return false ;
201206 }
@@ -207,9 +212,9 @@ namespace websockets {
207212 return false ;
208213 }
209214
210- bool WebsocketsClient::sendBinary (WSString data) {
215+ bool WebsocketsClient::sendBinary (WSInterfaceString data) {
211216 if (available ()) {
212- return WebsocketsEndpoint::send (data, MessageType::Binary);
217+ return WebsocketsEndpoint::send (internals::fromInterfaceString ( data) , MessageType::Binary);
213218 }
214219 return false ;
215220 }
@@ -229,12 +234,12 @@ namespace websockets {
229234 return _connectionOpen;
230235 }
231236
232- bool WebsocketsClient::ping (WSString data) {
233- return WebsocketsEndpoint::ping (data);
237+ bool WebsocketsClient::ping (WSInterfaceString data) {
238+ return WebsocketsEndpoint::ping (internals::fromInterfaceString ( data) );
234239 }
235240
236- bool WebsocketsClient::pong (WSString data) {
237- return WebsocketsEndpoint::pong (data);
241+ bool WebsocketsClient::pong (WSInterfaceString data) {
242+ return WebsocketsEndpoint::pong (internals::fromInterfaceString ( data) );
238243 }
239244
240245 void WebsocketsClient::close () {
0 commit comments