(ws push_server) on the server side, stop sending and close the connection when the remote end has disconnected
This commit is contained in:
		@@ -2,6 +2,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
All changes to this project will be documented in this file.
 | 
					All changes to this project will be documented in this file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [10.2.7] - 2020-08-18
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(ws push_server) on the server side, stop sending and close the connection when the remote end has disconnected
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [10.2.6] - 2020-08-17
 | 
					## [10.2.6] - 2020-08-17
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(ixwebsocket) replace std::unique_ptr<unsigned char[]> with std::array for some fixed arrays (which are in C++11)
 | 
					(ixwebsocket) replace std::unique_ptr<unsigned char[]> with std::array for some fixed arrays (which are in C++11)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,4 +6,4 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IX_WEBSOCKET_VERSION "10.2.6"
 | 
					#define IX_WEBSOCKET_VERSION "10.2.7"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1692,7 +1692,13 @@ namespace ix
 | 
				
			|||||||
                    bool binary = false;
 | 
					                    bool binary = false;
 | 
				
			||||||
                    while (true)
 | 
					                    while (true)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        webSocket.send(sendMsg, binary);
 | 
					                        auto sendInfo = webSocket.send(sendMsg, binary);
 | 
				
			||||||
 | 
					                        if (!sendInfo.success)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            spdlog::info("Error sending message, closing connection");
 | 
				
			||||||
 | 
					                            webSocket.close();
 | 
				
			||||||
 | 
					                            break;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else if (msg->type == ix::WebSocketMessageType::Close)
 | 
					                else if (msg->type == ix::WebSocketMessageType::Close)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user