A new object oriented network api that can be used to replace the one provided by the EthernetInterface library.

Dependents:   NetRelais TCP_Client_Example TCP_Server_Example UDP_Server_Example ... more

Object oriented network interface for the mbed platform

Currently implemented:

  • Address
  • Endpoint
  • UDP Socket
  • TCP Socket
  • Databuffer
  • Select API

It depends on the EthernetInterface for the lwip network stack.

Please do not hesitate to contact me with any remarks, improvements or questions.

The API is also available for unix at GitHub: LibNosa

Examples

Revision:
3:d30db8752485
Parent:
1:6956f6f96fef
Child:
4:d854fa394f85
--- a/tcp/socket.hpp	Tue Jul 17 18:31:22 2012 +0000
+++ b/tcp/socket.hpp	Wed Jul 18 11:22:37 2012 +0000
@@ -28,26 +28,26 @@
 
 #include "../socket.hpp"
 #include "../ip/address.hpp"
+#include "../ip/endpoint.hpp"
 
 namespace network {
 namespace tcp {
 
     class Socket :
         public network::Socket
-    {
-        protected:
-            int _max_pending;
-        
-        public:    
-            ~Socket();
+    {        
+        public:            
+            int open();
             
-            int open();
-            int close();
-            int bind(int port);
-            int listen(int max_pending);
+            int connect(ip::Address &address, int port);
+            int connect(ip::Endpoint &endpoint);
+            int shutdown();
+            
+            int listen(int max_pending = 10);
+            int accept(Socket &client);
         
-            int send(void *data, size_t size);
-            int reveive(void *data, size_t max_size);
+            int write(void *data, size_t size);
+            int read(void *data, size_t max_size);
     };
 
 } // namespace tcp