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:
@ -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();
|
||||
|
Reference in New Issue
Block a user