Skip to content

fix a bug #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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