Change connection listen method to return a boolean indicating whether the socket began to listen successfully. TODO: Use this value usefully.

git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@109 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b
master
follower 17 years ago
parent b0cfc84abe
commit 2fc2cf46a8

@ -225,7 +225,7 @@ class NetworkConnection { // Essentially a Socket wrapper
public: public:
NetworkConnection(uint16_t port); // TODO: Add UDP, TCP choice? NetworkConnection(uint16_t port); // TODO: Add UDP, TCP choice?
void listen(); // TODO: Return a useful value? int listen();
int isConnected(); int isConnected();
byte read(); byte read();
void NetworkConnection::close(); void NetworkConnection::close();
@ -243,11 +243,11 @@ NetworkConnection::NetworkConnection(uint16_t port) {
socket(_socket, Sn_MR_TCP, port, 0); socket(_socket, Sn_MR_TCP, port, 0);
} }
void NetworkConnection::listen() { // TODO: Make private or protected? int NetworkConnection::listen() { // TODO: Make private or protected?
/* /*
*/ */
::listen(_socket); // TODO: Use C++ namespaces for the driver functions? return !!::listen(_socket); // TODO: Use C++ namespaces for the driver functions?
} }
byte NetworkConnection::read() { byte NetworkConnection::read() {

Loading…
Cancel
Save