Port of LwIP performed by Ralf in 2010. Not recommended for use with recent mbed libraries, but good demos of raw LwIP possible

Dependents:   LwIP_raw_API_serverExample tiny-dtls

Core/TCPItem.cpp

Committer:
RodColeman
Date:
2012-09-18
Revision:
0:0791c1fece8e

File content as of revision 0:0791c1fece8e:

#include "TCPItem.h"

using namespace std;
using namespace mbed;

void TCPItem::abort() const {
  tcp_abort(this->_pcb);
}

void TCPItem::release_callbacks() const {
  tcp_arg(this->_pcb, NULL);
  tcp_sent(this->_pcb, NULL);
  tcp_recv(this->_pcb, NULL);
  tcp_poll(this->_pcb, NULL, 255);
  tcp_accept(this->_pcb, NULL);
  tcp_err(this->_pcb, NULL);
}

err_t TCPItem::close() {
  err_t err = tcp_close(this->_pcb);
  this->_pcb = NULL;
  return err;
}

void TCPItem::open() {
  if(!this->_pcb) {
    this->_pcb = tcp_new();
    tcp_arg(this->_pcb, this);
  }
}