No more update~~ please use W5500Interface.

Fork of EthernetInterfaceW5500 by Bongjun Hur


Bongjun Hur wrote:

NO more update for this library.

Please move to this page W5500Interface for newer version.

Import libraryW5500Interface

This is the Interface library for WIZnet W5500 chip which forked of EthernetInterfaceW5500, WIZnetInterface and WIZ550ioInterface. This library has simple name as "W5500Interface". and can be used for Wiz550io users also.

This Library for W5500 users. no need to use lwIP(or S/W TCP/IP) Some update & code clean for W5500 only refer from WIZ550ioInterface, WIZnetLibrary and WiflyInterface.

Thanks for ban4jp. This library forks of WIZ550ioInterface.

Files at this revision

API Documentation at this revision

Comitter:
ppo
Date:
Fri Aug 29 12:00:38 2014 +0000
Parent:
14:a089e591e530
Commit message:
bug fixed in close(), now socket is really closed

Changed in this revision

Socket/Socket.cpp Show annotated file Show diff for this revision Revisions of this file
Socket/TCPSocketServer.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a089e591e530 -r fe68ac753657 Socket/Socket.cpp
--- a/Socket/Socket.cpp	Tue Aug 19 23:32:48 2014 +0000
+++ b/Socket/Socket.cpp	Fri Aug 29 12:00:38 2014 +0000
@@ -35,8 +35,10 @@
 int Socket::close()
 {
     // add this code refer from EthernetInterface.
+    int res;
+    res = eth->close(_sock_fd);
     _sock_fd = -1;
-    return (eth->close(_sock_fd)) ? 0 : -1;
+    return (res)? 0: -1;
 }
 
 Socket::~Socket()
diff -r a089e591e530 -r fe68ac753657 Socket/TCPSocketServer.cpp
--- a/Socket/TCPSocketServer.cpp	Tue Aug 19 23:32:48 2014 +0000
+++ b/Socket/TCPSocketServer.cpp	Fri Aug 29 12:00:38 2014 +0000
@@ -81,12 +81,15 @@
     // and then, for the next connection, server socket should be assigned new one.
     _sock_fd = -1; // want to assign new available _sock_fd.
     if(bind(listen_port) < 0) {
-        error("No more socket for listening");
+        error("No more socket for listening, bind error");
+        return -1;
     } else {
         //return -1;
         if(listen(1) < 0) {
-            error("No more socket for listening");
+            error("No more socket for listening, listen error");
+            return -1;
         }
+        
     }
     return 0;
 }