modified by ohneta
Dependents: HelloESP8266Interface_mine
Fork of NetworkSocketAPI by
SocketInterface.h
- Committer:
- sam_grove
- Date:
- 2015-06-17
- Revision:
- 7:b147c08301be
- Parent:
- 2:ce08986b18b5
- Child:
- 8:4b7f97a5597b
File content as of revision 7:b147c08301be:
/* SocketInterface Base Class * Copyright (c) 2015 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SOCKETINTERFACE_H #define SOCKETINTERFACE_H /** SocketInterface class. * This is a common interface that is shared between all sockets that connect * using the NetworkInterface. */ class SocketInterface { public: // /** 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(); }; #endif