My fork of the HTTPServer (working)

Dependents:   DGWWebServer LAN2

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TCPItem.cpp Source File

TCPItem.cpp

00001 #include "TCPItem.h"
00002 
00003 using namespace std;
00004 using namespace mbed;
00005 
00006 void TCPItem::abort() const {
00007   tcp_abort(this->_pcb);
00008 }
00009 
00010 void TCPItem::release_callbacks() const {
00011   tcp_arg(this->_pcb, NULL);
00012   tcp_sent(this->_pcb, NULL);
00013   tcp_recv(this->_pcb, NULL);
00014   tcp_poll(this->_pcb, NULL, 255);
00015   tcp_accept(this->_pcb, NULL);
00016   tcp_err(this->_pcb, NULL);
00017 }
00018 
00019 err_t TCPItem::close() {
00020   err_t err = tcp_close(this->_pcb);
00021   this->_pcb = NULL;
00022   return err;
00023 }
00024 
00025 void TCPItem::open() {
00026   if(!this->_pcb) {
00027     this->_pcb = tcp_new();
00028     tcp_arg(this->_pcb, this);
00029   }
00030 }