Gill Wei / WIFI_API_32kRAM

Fork of WIFI_API_32kRAM by Delta

Committer:
wgd8700
Date:
Mon Aug 31 07:18:11 2015 +0000
Revision:
6:d68eb50990bd
Soft AP mode enabled (need to program SoftAP_FW_update.hex in advance)

Who changed what in which revision?

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