Initializes Socket instances for each namespaces. @param nsp namespace. @param opts options. @return a socket instance for the namespace.
(final String nsp, Options opts)
| 371 | * @return a socket instance for the namespace. |
| 372 | */ |
| 373 | public Socket socket(final String nsp, Options opts) { |
| 374 | synchronized (this.nsps) { |
| 375 | Socket socket = this.nsps.get(nsp); |
| 376 | if (socket == null) { |
| 377 | socket = new Socket(this, nsp, opts); |
| 378 | this.nsps.put(nsp, socket); |
| 379 | } |
| 380 | return socket; |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | public Socket socket(String nsp) { |
| 385 | return socket(nsp, null); |