NetworkSocketAPI
Dependents: HelloWizFi250Interface
Fork of NetworkSocketAPI by
Revision 14:9e1bd182ef07, committed 2015-07-22
- Comitter:
- bridadan
- Date:
- Wed Jul 22 20:16:57 2015 +0000
- Parent:
- 13:f84e69b3fdd3
- Child:
- 15:e657a90d9511
- Commit message:
- Adding handle to SocketInterface and updating map key type
Changed in this revision
NetworkInterface.h | Show annotated file Show diff for this revision Revisions of this file |
SocketInterface.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/NetworkInterface.h Fri Jul 17 23:14:01 2015 +0000 +++ b/NetworkInterface.h Wed Jul 22 20:16:57 2015 +0000 @@ -94,7 +94,7 @@ protected: /** Map used to keep track of all SocketInterface instances */ - std::map<int, SocketInterface*> sockets; + std::map<uint32_t, SocketInterface*> sockets; /** Counter used to create unique handles for new sockets. Should be incremented whenever a new socket is created.
--- a/SocketInterface.h Fri Jul 17 23:14:01 2015 +0000 +++ b/SocketInterface.h Wed Jul 22 20:16:57 2015 +0000 @@ -138,9 +138,15 @@ @return 0 on success, -1 on failure (when an hostname cannot be resolved by DNS). */ virtual int32_t close() const = 0; + + /** Get the socket's unique handle + @return socket's handle number + */ + virtual uint32_t getHandle() const = 0; + protected: socket_protocol_t _type; - + uint32_t _handle; }; #endif