WebSocketServer test

Dependencies:   mbed

Committer:
gtk2k
Date:
Sun Apr 29 03:58:08 2012 +0000
Revision:
0:74be48b504a5
WebSocketServer

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gtk2k 0:74be48b504a5 1
gtk2k 0:74be48b504a5 2 /*
gtk2k 0:74be48b504a5 3 Copyright (c) 2010 Donatien Garnier (donatiengar [at] gmail [dot] com)
gtk2k 0:74be48b504a5 4
gtk2k 0:74be48b504a5 5 Permission is hereby granted, free of charge, to any person obtaining a copy
gtk2k 0:74be48b504a5 6 of this software and associated documentation files (the "Software"), to deal
gtk2k 0:74be48b504a5 7 in the Software without restriction, including without limitation the rights
gtk2k 0:74be48b504a5 8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
gtk2k 0:74be48b504a5 9 copies of the Software, and to permit persons to whom the Software is
gtk2k 0:74be48b504a5 10 furnished to do so, subject to the following conditions:
gtk2k 0:74be48b504a5 11
gtk2k 0:74be48b504a5 12 The above copyright notice and this permission notice shall be included in
gtk2k 0:74be48b504a5 13 all copies or substantial portions of the Software.
gtk2k 0:74be48b504a5 14
gtk2k 0:74be48b504a5 15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
gtk2k 0:74be48b504a5 16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
gtk2k 0:74be48b504a5 17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
gtk2k 0:74be48b504a5 18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
gtk2k 0:74be48b504a5 19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
gtk2k 0:74be48b504a5 20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
gtk2k 0:74be48b504a5 21 THE SOFTWARE.
gtk2k 0:74be48b504a5 22 */
gtk2k 0:74be48b504a5 23
gtk2k 0:74be48b504a5 24 #ifndef NETIF_H
gtk2k 0:74be48b504a5 25 #define NETIF_H
gtk2k 0:74be48b504a5 26
gtk2k 0:74be48b504a5 27 #include "core/ipaddr.h"
gtk2k 0:74be48b504a5 28 /*
gtk2k 0:74be48b504a5 29 #include "nettcpsocket.h"
gtk2k 0:74be48b504a5 30 #include "netudpsocket.h"
gtk2k 0:74be48b504a5 31 #include "netdnsrequest.h"
gtk2k 0:74be48b504a5 32 */
gtk2k 0:74be48b504a5 33 class NetTcpSocket;
gtk2k 0:74be48b504a5 34 class NetUdpSocket;
gtk2k 0:74be48b504a5 35 class NetDnsRequest;
gtk2k 0:74be48b504a5 36
gtk2k 0:74be48b504a5 37 #if 0
gtk2k 0:74be48b504a5 38 enum NetifEvent
gtk2k 0:74be48b504a5 39 {
gtk2k 0:74be48b504a5 40 NETIF_CONNECTED, //Connected, can create & use sockets now
gtk2k 0:74be48b504a5 41 NETIF_DNSREPLY,
gtk2k 0:74be48b504a5 42 NETIF_DISCONNECTED
gtk2k 0:74be48b504a5 43 };
gtk2k 0:74be48b504a5 44 #endif
gtk2k 0:74be48b504a5 45
gtk2k 0:74be48b504a5 46 class NetIf
gtk2k 0:74be48b504a5 47 {
gtk2k 0:74be48b504a5 48 public:
gtk2k 0:74be48b504a5 49 NetIf();
gtk2k 0:74be48b504a5 50 virtual ~NetIf();
gtk2k 0:74be48b504a5 51 virtual NetTcpSocket* tcpSocket() = 0; //Create a new tcp socket
gtk2k 0:74be48b504a5 52 virtual NetUdpSocket* udpSocket() = 0; //Create a new udp socket
gtk2k 0:74be48b504a5 53 virtual void poll() = 0;
gtk2k 0:74be48b504a5 54 virtual NetDnsRequest* dnsRequest(const char* hostname) = 0; //Create a new NetDnsRequest object
gtk2k 0:74be48b504a5 55 virtual NetDnsRequest* dnsRequest(Host* pHost) = 0; //Create a new NetDnsRequest object
gtk2k 0:74be48b504a5 56
gtk2k 0:74be48b504a5 57 //!Returns the IP of the interface once it's connected
gtk2k 0:74be48b504a5 58 IpAddr getIp() const;
gtk2k 0:74be48b504a5 59
gtk2k 0:74be48b504a5 60 protected:
gtk2k 0:74be48b504a5 61 IpAddr m_ip;
gtk2k 0:74be48b504a5 62 };
gtk2k 0:74be48b504a5 63
gtk2k 0:74be48b504a5 64 #endif