@@ -418,12 +418,13 @@ private void onerror(Exception err) {
418418 * Initializes {@link Socket} instances for each namespaces.
419419 *
420420 * @param nsp namespace.
421+ * @param opts options.
421422 * @return a socket instance for the namespace.
422423 */
423- public Socket socket (String nsp ) {
424+ public Socket socket (String nsp , Options opts ) {
424425 Socket socket = this .nsps .get (nsp );
425426 if (socket == null ) {
426- socket = new Socket (this , nsp );
427+ socket = new Socket (this , nsp , opts );
427428 Socket _socket = this .nsps .putIfAbsent (nsp , socket );
428429 if (_socket != null ) {
429430 socket = _socket ;
@@ -447,6 +448,10 @@ public void call(Object... objects) {
447448 return socket ;
448449 }
449450
451+ public Socket socket (String nsp ) {
452+ return socket (nsp , null );
453+ }
454+
450455 /*package*/ void destroy (Socket socket ) {
451456 this .connecting .remove (socket );
452457 if (!this .connecting .isEmpty ()) return ;
@@ -458,6 +463,10 @@ public void call(Object... objects) {
458463 logger .fine (String .format ("writing packet %s" , packet ));
459464 final Manager self = this ;
460465
466+ if (packet .query != null && !packet .query .isEmpty () && packet .type == Parser .CONNECT ) {
467+ packet .nsp += "?" + packet .query ;
468+ }
469+
461470 if (!self .encoding ) {
462471 self .encoding = true ;
463472 this .encoder .encode (packet , new Parser .Encoder .Callback () {
0 commit comments