Skip to content

Commit 2efb660

Browse files
authored
Merge pull request #6 from HuoHuas001/main
refactor(websocket): 在连接前先关闭现有连接
2 parents 43e0596 + 024d99f commit 2efb660

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/WebSocketClient.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ namespace cyanray
245245

246246
void WebSocketClient::Connect(const string& hostname, int port, const string& path)
247247
{
248+
Shutdown();
248249
PrivateMembers->wsSocket = hostname_connect(hostname, port);
249250
if (PrivateMembers->wsSocket == INVALID_SOCKET)
250251
{

0 commit comments

Comments
 (0)