Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Core/TCPItem.cpp
- Revision:
- 0:6dee052a3fa4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Core/TCPItem.cpp Tue Jul 26 05:30:53 2011 +0000
@@ -0,0 +1,30 @@
+#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);
+ }
+}