Wrapper of NetworkSocketAPI for BSD sockets on POSIX systems

Dependents:   BSDInterfaceTests HelloBSDInterface

Files at this revision

API Documentation at this revision

Comitter:
Christopher Haster
Date:
Thu Feb 25 19:04:44 2016 -0600
Parent:
3:eabc4ea66a64
Child:
5:1af10f9d9404
Commit message:
Matched changes to NetworkSocketAPI

Changed in this revision

BSDInterface.cpp Show annotated file Show diff for this revision Revisions of this file
BSDInterface.h Show annotated file Show diff for this revision Revisions of this file
--- a/BSDInterface.cpp	Sun Feb 28 10:54:31 2016 -0600
+++ b/BSDInterface.cpp	Thu Feb 25 19:04:44 2016 -0600
@@ -131,9 +131,9 @@
 };
 
 
-SocketInterface *BSDInterface::createSocket(socket_protocol_t proto)
+SocketInterface *BSDInterface::createSocket(ns_protocol_t proto)
 {
-    int type = (proto == SOCK_UDP) ? SOCK_DGRAM : SOCK_STREAM;
+    int type = (proto == NS_UDP) ? SOCK_DGRAM : SOCK_STREAM;
     int fd = ::socket(AF_INET, type, 0);
     if (fd < 0) {
         return 0;
--- a/BSDInterface.h	Sun Feb 28 10:54:31 2016 -0600
+++ b/BSDInterface.h	Thu Feb 25 19:04:44 2016 -0600
@@ -32,7 +32,7 @@
 
     virtual int32_t getHostByName(const char *host, char *ip);
 
-    virtual SocketInterface *createSocket(socket_protocol_t proto);
+    virtual SocketInterface *createSocket(ns_protocol_t proto);
     virtual void destroySocket(SocketInterface *socket);
 };