Home Alert System

Dependencies:   PWM_Tone_Library DHT

Committer:
aziz111
Date:
Fri Mar 08 17:15:02 2019 +0000
Revision:
5:569a4894abc1
Parent:
3:78f223d34f36
Final

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ethaderu 3:78f223d34f36 1 /* Copyright (C) 2012 mbed.org, MIT License
ethaderu 3:78f223d34f36 2 *
ethaderu 3:78f223d34f36 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
ethaderu 3:78f223d34f36 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
ethaderu 3:78f223d34f36 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
ethaderu 3:78f223d34f36 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
ethaderu 3:78f223d34f36 7 * furnished to do so, subject to the following conditions:
ethaderu 3:78f223d34f36 8 *
ethaderu 3:78f223d34f36 9 * The above copyright notice and this permission notice shall be included in all copies or
ethaderu 3:78f223d34f36 10 * substantial portions of the Software.
ethaderu 3:78f223d34f36 11 *
ethaderu 3:78f223d34f36 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ethaderu 3:78f223d34f36 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
ethaderu 3:78f223d34f36 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
ethaderu 3:78f223d34f36 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
ethaderu 3:78f223d34f36 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ethaderu 3:78f223d34f36 17 */
ethaderu 3:78f223d34f36 18 #ifndef TCPSOCKETSERVER_H
ethaderu 3:78f223d34f36 19 #define TCPSOCKETSERVER_H
ethaderu 3:78f223d34f36 20
ethaderu 3:78f223d34f36 21 #include "Socket/Socket.h"
ethaderu 3:78f223d34f36 22 #include "TCPSocketConnection.h"
ethaderu 3:78f223d34f36 23
ethaderu 3:78f223d34f36 24 /** TCP Server.
ethaderu 3:78f223d34f36 25 */
ethaderu 3:78f223d34f36 26 class TCPSocketServer : public Socket {
ethaderu 3:78f223d34f36 27 public:
ethaderu 3:78f223d34f36 28 /** Instantiate a TCP Server.
ethaderu 3:78f223d34f36 29 */
ethaderu 3:78f223d34f36 30 TCPSocketServer();
ethaderu 3:78f223d34f36 31
ethaderu 3:78f223d34f36 32 /** Bind a socket to a specific port.
ethaderu 3:78f223d34f36 33 \param port The port to listen for incoming connections on.
ethaderu 3:78f223d34f36 34 \return 0 on success, -1 on failure.
ethaderu 3:78f223d34f36 35 */
ethaderu 3:78f223d34f36 36 int bind(int port);
ethaderu 3:78f223d34f36 37
ethaderu 3:78f223d34f36 38 /** Start listening for incoming connections.
ethaderu 3:78f223d34f36 39 \param backlog number of pending connections that can be queued up at any
ethaderu 3:78f223d34f36 40 one time [Default: 1].
ethaderu 3:78f223d34f36 41 \return 0 on success, -1 on failure.
ethaderu 3:78f223d34f36 42 */
ethaderu 3:78f223d34f36 43 int listen(int backlog=1);
ethaderu 3:78f223d34f36 44
ethaderu 3:78f223d34f36 45 /** Accept a new connection.
ethaderu 3:78f223d34f36 46 \param connection A TCPSocketConnection instance that will handle the incoming connection.
ethaderu 3:78f223d34f36 47 \return 0 on success, -1 on failure.
ethaderu 3:78f223d34f36 48 */
ethaderu 3:78f223d34f36 49 int accept(TCPSocketConnection& connection);
ethaderu 3:78f223d34f36 50 };
ethaderu 3:78f223d34f36 51
ethaderu 3:78f223d34f36 52 #endif