Add connection byte read method--not yet used.

git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@107 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b
master
follower 17 years ago
parent c89615a4a3
commit 4979f30019

@ -226,8 +226,8 @@ class NetworkConnection { // Essentially a Socket wrapper
NetworkConnection(uint16_t port); // TODO: Add UDP, TCP choice?
void listen(); // TODO: Return a useful value?
int isConnected();
byte read();
void NetworkConnection::close();
private:
@ -250,6 +250,17 @@ void NetworkConnection::listen() { // TODO: Make private or protected?
::listen(_socket); // TODO: Use C++ namespaces for the driver functions?
}
byte NetworkConnection::read() {
/*
Note: This blocks until a byte is available.
*/
uint8_t theByte;
recv(_socket, &theByte, 1);
return theByte;
}
int NetworkConnection::isConnected() {
/*

Loading…
Cancel
Save