modified by ohneta
Dependents: HelloESP8266Interface_mine
Fork of NetworkSocketAPI by
Diff: SocketInterface.h
- Revision:
- 7:b147c08301be
- Parent:
- 2:ce08986b18b5
- Child:
- 8:4b7f97a5597b
diff -r 7437289cb2e9 -r b147c08301be SocketInterface.h --- a/SocketInterface.h Mon Jun 01 16:21:59 2015 -0500 +++ b/SocketInterface.h Wed Jun 17 20:56:15 2015 +0000 @@ -24,50 +24,63 @@ class SocketInterface { public: - /** - * This enum defines the possible socket protocol families. - */ - enum ProtocolFamily { - AF_INET, /**< IPv4 */ - AF_INET6, /**< IPV6 */ - AF_UNIX /**< Local socket (using a file) */ - }; - - /** - * This enum defines the possible socket types. - */ - enum SockType { - SOCK_STREAM, /**< Stream socket, generally used for TCP */ - SOCK_DGRAM, /**< Datagram socket, generally used for UDP */ - SOCK_SEQPACKET, /**< Reliable sequenced packet service */ - SOCK_RAW /**< Raw protocols atop the network layer */ - }; - - /** - * Configure the socket's protocol and type. - * - * @param protocol The protocol to use. - * @param type The type of socket to use. - */ - virtual int config(ProtocolFamily protocol, SockType type) = 0; - - /** - * Set blocking or non-blocking mode of the socket and a timeout on - * blocking socket operations. - * - * @param blocking true for blocking mode, false for non-blocking mode. - * @param timeout timeout in ms [Default: (1500)ms]. - */ - virtual void setBlocking(bool blocking, unsigned int timeout=1500) = 0; - - /* - "options" functions here? Not familiar with this, need to discuss - */ - - /** - * Close the socket - */ - virtual void close(); +// /** This enum defines the possible socket domain types. +// */ +// typedef enum { +// AF_INET, /*!< IPv4 */ +// AF_INET6, /*!< IPV6 */ +// AF_UNIX /*!< Local socket (using a file) */ +// } socket_domain_t; +// +// /** This enum defines the possible socket types. +// */ +// typedef enum { +// SOCK_STREAM, /*!< Reliable stream-oriented service or Stream Sockets */ +// SOCK_DGRAM, /**< Datagram service or Datagram Sockets */ +// SOCK_SEQPACKET, /*!< Reliable sequenced packet service */ +// SOCK_RAW /*!< Raw protocols atop the network layer */ +// } socket_type_t; +// +// /** This enum defines the ip protocols +// */ +// typedef enum { +// IPPROTO_TCP, /*!< Socket connection over TCP */ +// IPPROTO_UDP, /*!< Socket connection over UDP */ +// IPPROTO_SCTP /*!< Socket connection over SCTP */ +// IPPROTO_DCCP, /*!< Socket connection over DCCP */ +// } socket_type_t; +// +// /** Configure the socket's protocol and type. +// @param protocol The protocol to use. +// @param type The type of socket to use. +// @returns 0 on success, a negative number on failure +// */ +// virtual int32_t socket(socket_domain_t protocol, socket_type_t type, ) const = 0; +// +// /** Configure the socket's protocol and type. +// @param protocol The protocol to use. +// @param type The type of socket to use. +// @returns 0 on success, a negative number on failure +// */ +// virtual int bind(const struct sockaddr *my_addr, socklen_t addrlen); +// +// /** +// * Set blocking or non-blocking mode of the socket and a timeout on +// * blocking socket operations. +// * +// * @param blocking true for blocking mode, false for non-blocking mode. +// * @param timeout timeout in ms [Default: (1500)ms]. +// */ +// virtual void setBlocking(bool blocking, unsigned int timeout=1500) = 0; +// +// /* +// "options" functions here? Not familiar with this, need to discuss +// */ +// +// /** +// * Close the socket +// */ +// virtual void close(); };