Skip to content

Commit

Permalink
Fix socket intermittent issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wggihan committed Mar 18, 2019
1 parent 917a6d4 commit b4421aa
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ int joinee = 0;

service echoServer on server {
resource function onConnect(socket:Caller caller) {
joinee = joinee + 1;
io:println("Join: ", joinee);
lock {
joinee = joinee + 1;
io:println("Join: ", joinee);
}
}

resource function onReadReady(socket:Caller caller) {
Expand Down

0 comments on commit b4421aa

Please sign in to comment.