Update: Add Client Address to CONNECT reject error message.

Update: comment out the generating CONNACK reply.

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2016-10-18 10:06:02 +09:00
parent 9b7c25b28c
commit b87c8412f8
6 changed files with 34 additions and 13 deletions

View File

@@ -101,6 +101,15 @@ SensorNetAddress& SensorNetAddress::operator =(SensorNetAddress& addr)
return *this;
}
char* SensorNetAddress::sprint(char* buf)
{
struct in_addr inaddr = { _IpAddr };
char* ip = inet_ntoa(inaddr);
sprintf( buf, "%s:", ip);
sprintf( buf + strlen(buf), "%d", ntohs(_portNo));
return buf;
}
/*===========================================
Class SensorNetwork
============================================*/

View File

@@ -45,7 +45,7 @@ public:
uint32_t getIpAddress(void);
bool isMatch(SensorNetAddress* addr);
SensorNetAddress& operator =(SensorNetAddress& addr);
char* sprint(char* buf);
private:
uint16_t _portNo;
uint32_t _IpAddr;