org.jetlang.web

## Class WebSocketClient<S,T>

- java.lang.Object
- - org.jetlang.web.WebSocketClient<S,T>

    public class WebSocketClient<S,T>
    extends Object

### Nested Class Summary

Nested Classes
`static class` `WebSocketClient.Config`

### Constructor Summary

Constructors
Constructor and Description
`WebSocketClient(org.jetlang.fibers.NioFiber readFiber, URI uri, WebSocketClient.Config config, WebSocketHandler<S,T> handler, SessionFactory<S> sessionFactory)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addCookie(HttpCookie httpCookie)`
`protected void` `addHeadersToHandshake(HttpRequest request)`
`protected boolean` `canAttemptConnect()` hook method to allow subclasses to implement custom connect conditions.
`void` `clearCookies()`
`protected ByteBuffer` `createHandshake(SocketAddress remoteAddress)`
`void` `removeCookie(String name)`
`SendResult` `send(String msg)`
`void` `setCookie(HttpCookie httpCookie)`
`CountDownLatch` `start()`
`void` `stop()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### WebSocketClient

    public WebSocketClient(org.jetlang.fibers.NioFiber readFiber,
                           URI uri,
                           WebSocketClient.Config config,
                           WebSocketHandler<S,T> handler,
                           SessionFactory<S> sessionFactory)

### Method Detail

#### addCookie

    public void addCookie(HttpCookie httpCookie)

#### setCookie

    public void setCookie(HttpCookie httpCookie)

#### removeCookie

    public void removeCookie(String name)

#### clearCookies

    public void clearCookies()

#### start

    public CountDownLatch start()

#### canAttemptConnect

    protected boolean canAttemptConnect()

hook method to allow subclasses to implement custom connect conditions.

Returns:
  false to delay connection for connect timeout.

#### createHandshake

    protected ByteBuffer createHandshake(SocketAddress remoteAddress)

#### addHeadersToHandshake

    protected void addHeadersToHandshake(HttpRequest request)

#### stop

    public void stop()

#### send

    public SendResult send(String msg)