Add 'isConnected' method to 'NetworkConnection' in prepartion for use.

git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@102 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b
master
follower 17 years ago
parent 45481088d4
commit 6e0f16aec1

@ -219,6 +219,7 @@ void Wiz810MjDevice::setMac(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5
// TODO: Make this 'NetworkServerConnection'? Or just 'ServerConnection'? // TODO: Make this 'NetworkServerConnection'? Or just 'ServerConnection'?
// TODO: Pull one-line methods into class definition to allow inlining?
class NetworkConnection { // Essentially a Socket wrapper class NetworkConnection { // Essentially a Socket wrapper
public: public:
@ -226,6 +227,8 @@ class NetworkConnection { // Essentially a Socket wrapper
void listen(); // TODO: Return a useful value? void listen(); // TODO: Return a useful value?
int isConnected();
private: private:
SOCKET _socket; SOCKET _socket;
}; };
@ -244,6 +247,15 @@ void NetworkConnection::listen() { // TODO: Make private or protected?
::listen(_socket); // TODO: Use C++ namespaces for the driver functions? ::listen(_socket); // TODO: Use C++ namespaces for the driver functions?
} }
int NetworkConnection::isConnected() {
/*
*/
// TODO: If we want the 'Network*' classes to be generic we
// would need to handle this differently:
return (getSn_SR(_socket) == SOCK_ESTABLISHED);
}
/* ----------------------- */ /* ----------------------- */
/* -- NetworkInterface -- */ /* -- NetworkInterface -- */

Loading…
Cancel
Save