The code from https://github.com/vpcola/Nucleo

Committer:
sinrab
Date:
Wed Oct 08 11:00:24 2014 +0000
Revision:
0:5464d5e415e5
The code from https://github.com/vpcola/Nucleo

Who changed what in which revision?

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