1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

Adding Client::peek() in Ethernet library (issue #349).

This commit is contained in:
David A. Mellis
2010-09-16 01:11:19 +00:00
parent 76641d1a87
commit ea8a1182b8
6 changed files with 30 additions and 4 deletions

View File

@ -83,6 +83,14 @@ int Client::read() {
return b;
}
int Client::peek() {
uint8_t b;
if (!available())
return -1;
::peek(_sock, &b);
return b;
}
void Client::flush() {
while (available())
read();