# _ClientConnHandler
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L4)</span>

This is the network notification handler for the client. It passes
received data to the `HTTPParser` to assemble response `Payload` objects.


```pony
class ref _ClientConnHandler is
  TCPConnectionNotify ref
```

#### Implements

* [TCPConnectionNotify](net-TCPConnectionNotify) ref

---

## Constructors

### create
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L14)</span>


The response builder needs to know which Session to forward
parsed information to.


```pony
new iso create(
  client: _ClientConnection tag)
: _ClientConnHandler iso^
```
#### Parameters

*   client: [_ClientConnection](net-http-_ClientConnection) tag

#### Returns

* [_ClientConnHandler](net-http-_ClientConnHandler) iso^

---

## Public Functions

### connected
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L22)</span>


Tell the client we have connected.


```pony
fun ref connected(
  conn: TCPConnection ref)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref

#### Returns

* [None](builtin-None) val

---

### connect_failed
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L28)</span>


The connection could not be established. Tell the client not to proceed.


```pony
fun ref connect_failed(
  conn: TCPConnection ref)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref

#### Returns

* [None](builtin-None) val

---

### auth_failed
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L34)</span>


SSL authentication failed. Tell the client not to proceed.


```pony
fun ref auth_failed(
  conn: TCPConnection ref)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref

#### Returns

* [None](builtin-None) val

---

### received
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L40)</span>


Pass a received chunk of data to the `_HTTPParser`.


```pony
fun ref received(
  conn: TCPConnection ref,
  data: Array[U8 val] iso,
  times: USize val)
: Bool val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref
*   data: [Array](builtin-Array)\[[U8](builtin-U8) val\] iso
*   times: [USize](builtin-USize) val

#### Returns

* [Bool](builtin-Bool) val

---

### closed
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L58)</span>


The connection has closed, possibly prematurely.


```pony
fun ref closed(
  conn: TCPConnection ref)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref

#### Returns

* [None](builtin-None) val

---

### throttled
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L66)</span>


TCP connection wants us to stop sending. We do not do anything with
this here;  just pass it on to the `HTTPSession`.


```pony
fun ref throttled(
  conn: TCPConnection ref)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref

#### Returns

* [None](builtin-None) val

---

### unthrottle
<span class="source-link">[[Source]](src/net-http/_client_conn_handler.md#L73)</span>


TCP can accept more data now. We just pass this on to the
`HTTPSession`


```pony
fun ref unthrottle(
  conn: TCPConnection ref)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref

#### Returns

* [None](builtin-None) val

---

### accepted
<span class="source-link">[[Source]](src/net/tcp_connection_notify.md#L8)</span>


```pony
fun ref accepted(
  conn: TCPConnection ref)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref

#### Returns

* [None](builtin-None) val

---

### connecting
<span class="source-link">[[Source]](src/net/tcp_connection_notify.md#L14)</span>


```pony
fun ref connecting(
  conn: TCPConnection ref,
  count: U32 val)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref
*   count: [U32](builtin-U32) val

#### Returns

* [None](builtin-None) val

---

### sent
<span class="source-link">[[Source]](src/net/tcp_connection_notify.md#L51)</span>


```pony
fun ref sent(
  conn: TCPConnection ref,
  data: (String val | Array[U8 val] val))
: (String val | Array[U8 val] val)
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref
*   data: ([String](builtin-String) val | [Array](builtin-Array)\[[U8](builtin-U8) val\] val)

#### Returns

* ([String](builtin-String) val | [Array](builtin-Array)\[[U8](builtin-U8) val\] val)

---

### sentv
<span class="source-link">[[Source]](src/net/tcp_connection_notify.md#L59)</span>


```pony
fun ref sentv(
  conn: TCPConnection ref,
  data: ByteSeqIter val)
: ByteSeqIter val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref
*   data: [ByteSeqIter](builtin-ByteSeqIter) val

#### Returns

* [ByteSeqIter](builtin-ByteSeqIter) val

---

### expect
<span class="source-link">[[Source]](src/net/tcp_connection_notify.md#L85)</span>


```pony
fun ref expect(
  conn: TCPConnection ref,
  qty: USize val)
: USize val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref
*   qty: [USize](builtin-USize) val

#### Returns

* [USize](builtin-USize) val

---

### unthrottled
<span class="source-link">[[Source]](src/net/tcp_connection_notify.md#L109)</span>


```pony
fun ref unthrottled(
  conn: TCPConnection ref)
: None val
```
#### Parameters

*   conn: [TCPConnection](net-TCPConnection) ref

#### Returns

* [None](builtin-None) val

---

