Statistics
| Branch: | Revision:

root / arduino-1.0 / hardware / arduino / cores / arduino / Client.h @ 58d82c77

History | View | Annotate | Download (697 Bytes)

1
#ifndef client_h
2
#define client_h
3
#include "Print.h"
4
#include "Stream.h"
5
#include "IPAddress.h"
6

    
7
class Client : public Stream {
8

    
9
public:
10
  virtual int connect(IPAddress ip, uint16_t port) =0;
11
  virtual int connect(const char *host, uint16_t port) =0;
12
  virtual size_t write(uint8_t) =0;
13
  virtual size_t write(const uint8_t *buf, size_t size) =0;
14
  virtual int available() = 0;
15
  virtual int read() = 0;
16
  virtual int read(uint8_t *buf, size_t size) = 0;
17
  virtual int peek() = 0;
18
  virtual void flush() = 0;
19
  virtual void stop() = 0;
20
  virtual uint8_t connected() = 0;
21
  virtual operator bool() = 0;
22
protected:
23
  uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); };
24
};
25

    
26
#endif