mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-10-28 17:15:26 +03:00 
			
		
		
		
	Changed / added virtual functions for returning connection information (#8693)
Fixes the incorrect behavior of WiFiClientSecure.remoteIP(), .remotePort(), .localIP(), .localPort().
This commit is contained in:
		| @@ -91,10 +91,10 @@ public: | ||||
|   virtual uint8_t connected() override; | ||||
|   virtual operator bool() override; | ||||
|  | ||||
|   IPAddress remoteIP(); | ||||
|   uint16_t  remotePort(); | ||||
|   IPAddress localIP(); | ||||
|   uint16_t  localPort(); | ||||
|   virtual IPAddress remoteIP(); | ||||
|   virtual uint16_t  remotePort(); | ||||
|   virtual IPAddress localIP(); | ||||
|   virtual uint16_t  localPort(); | ||||
|  | ||||
|   static void setLocalPortStart(uint16_t port) { _localPort = port; } | ||||
|  | ||||
|   | ||||
| @@ -278,6 +278,11 @@ class WiFiClientSecure : public WiFiClient { | ||||
|     void flush() override { (void)flush(0); } | ||||
|     void stop() override { (void)stop(0); } | ||||
|  | ||||
|     IPAddress remoteIP() override { return _ctx->remoteIP(); } | ||||
|     uint16_t  remotePort() override { return _ctx->remotePort(); } | ||||
|     IPAddress localIP() override { return _ctx->localIP(); } | ||||
|     uint16_t  localPort() override { return _ctx->localPort(); } | ||||
|  | ||||
|     // Allow sessions to be saved/restored automatically to a memory area | ||||
|     void setSession(Session *session) { _ctx->setSession(session); } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user