Beispiel #1
0
void AsyncClient::_dns_found(ip_addr_t *ipaddr){
    _in_lwip_thread = true;
    if(ipaddr){
        connect(IPAddress(ipaddr->u_addr.ip4.addr), _connect_port);
    } else {
        log_e("dns fail");
        if(_error_cb)
            _error_cb(_error_cb_arg, this, -55);
        if(_discard_cb)
            _discard_cb(_discard_cb_arg, this);
    }
    _in_lwip_thread = false;
}
void AsyncClient::_error(int8_t err) {
  if(_error_cb) {
    _error_cb(_error_cb_arg, this, err);
  }
  if(err){
    if(_pcb) {
      _pcb->state = (tcp_state)0;
    }
    if(_discard_cb) {
      _discard_cb(_discard_cb_arg, this);
    }
  }
}
Beispiel #3
0
void AsyncClient::_error(int8_t err) {
    if(_pcb){
        tcp_arg(_pcb, NULL);
        tcp_sent(_pcb, NULL);
        tcp_recv(_pcb, NULL);
        tcp_err(_pcb, NULL);
        tcp_poll(_pcb, NULL, 0);
        _pcb = NULL;
    }
    if(_error_cb)
        _error_cb(_error_cb_arg, this, err);
    if(_discard_cb)
        _discard_cb(_discard_cb_arg, this);
}