Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions source/server/asio/tcp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@ bool TCPClient::ConnectAsync()
_bytes_sent = 0;
_bytes_received = 0;

// Call the client connected handler, onConnected will reset FBE buffers, so it could not be located after _connected flag changed
onConnected();

// Update the connected flag
_connected = true;

// Try to receive something from the server
TryReceive();

// Call the client connected handler
onConnected();
TryReceive();

// Call the empty send buffer handler
if (_send_buffer_main.empty())
Expand Down Expand Up @@ -409,16 +409,16 @@ bool TCPClient::ConnectAsync(const std::shared_ptr<TCPResolver>& resolver)
_bytes_sending = 0;
_bytes_sent = 0;
_bytes_received = 0;


// Call the client connected handler, onConnected will reset FBE buffers, so it could not be located after _connected flag changed
onConnected();

// Update the connected flag
_connected = true;

// Try to receive something from the server
TryReceive();

// Call the client connected handler
onConnected();

// Call the empty send buffer handler
if (_send_buffer_main.empty())
onEmpty();
Expand Down