fdsf

Dependents:   sisk_proj_stat MQTT Hello_FXOS8700Q WireFSHandControl ... more

Committer:
grzemich
Date:
Wed Dec 07 23:47:50 2016 +0000
Revision:
0:d7bd7384a37c
dgd

Who changed what in which revision?

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