f
Fork of lwip by
trunk/Core/TCPItem.cpp@1:803fdc96fbd7, 2017-08-03 (annotated)
- Committer:
- idijoeteque
- Date:
- Thu Aug 03 10:24:16 2017 +0000
- Revision:
- 1:803fdc96fbd7
- Parent:
- 0:5e1631496985
hello
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
root@mbed.org | 0:5e1631496985 | 1 | #include "TCPItem.h" |
root@mbed.org | 0:5e1631496985 | 2 | |
root@mbed.org | 0:5e1631496985 | 3 | using namespace std; |
root@mbed.org | 0:5e1631496985 | 4 | using namespace mbed; |
root@mbed.org | 0:5e1631496985 | 5 | |
root@mbed.org | 0:5e1631496985 | 6 | void TCPItem::abort() const { |
root@mbed.org | 0:5e1631496985 | 7 | tcp_abort(this->_pcb); |
root@mbed.org | 0:5e1631496985 | 8 | } |
root@mbed.org | 0:5e1631496985 | 9 | |
root@mbed.org | 0:5e1631496985 | 10 | void TCPItem::release_callbacks() const { |
root@mbed.org | 0:5e1631496985 | 11 | tcp_arg(this->_pcb, NULL); |
root@mbed.org | 0:5e1631496985 | 12 | tcp_sent(this->_pcb, NULL); |
root@mbed.org | 0:5e1631496985 | 13 | tcp_recv(this->_pcb, NULL); |
root@mbed.org | 0:5e1631496985 | 14 | tcp_poll(this->_pcb, NULL, 255); |
root@mbed.org | 0:5e1631496985 | 15 | tcp_accept(this->_pcb, NULL); |
root@mbed.org | 0:5e1631496985 | 16 | tcp_err(this->_pcb, NULL); |
root@mbed.org | 0:5e1631496985 | 17 | } |
root@mbed.org | 0:5e1631496985 | 18 | |
root@mbed.org | 0:5e1631496985 | 19 | err_t TCPItem::close() { |
root@mbed.org | 0:5e1631496985 | 20 | err_t err = tcp_close(this->_pcb); |
root@mbed.org | 0:5e1631496985 | 21 | this->_pcb = NULL; |
root@mbed.org | 0:5e1631496985 | 22 | return err; |
root@mbed.org | 0:5e1631496985 | 23 | } |
root@mbed.org | 0:5e1631496985 | 24 | |
root@mbed.org | 0:5e1631496985 | 25 | void TCPItem::open() { |
root@mbed.org | 0:5e1631496985 | 26 | if(!this->_pcb) { |
root@mbed.org | 0:5e1631496985 | 27 | this->_pcb = tcp_new(); |
root@mbed.org | 0:5e1631496985 | 28 | tcp_arg(this->_pcb, this); |
root@mbed.org | 0:5e1631496985 | 29 | } |
root@mbed.org | 0:5e1631496985 | 30 | } |