Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
- Decrease delay to reduce server latency
- Don't remove the first TX_Frame when sending a close control frame
  • Loading branch information
Dadido3 committed Feb 11, 2021
1 parent 6a5c349 commit 3c9cdb9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Includes/WebSocket_Server.pbi
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ Module WebSocket_Server

; #### Delay only if there is nothing to do
If Not Busy
Delay(10)
Delay(1)
EndIf

Until *Object\Free
Expand Down Expand Up @@ -871,10 +871,7 @@ Module WebSocket_Server
*Client\Event_Disconnect_Manually = #True

; #### Remove all TX_Frame elements (Except the one that is being sent right now).
While LastElement(*Client\TX_Frame())
If *Client\TX_Frame()\RxTx_Pos > 0
Break
EndIf
While LastElement(*Client\TX_Frame()) And ListIndex(*Client\TX_Frame()) > 0
If *Client\TX_Frame()\Data
FreeMemory(*Client\TX_Frame()\Data) : *Client\TX_Frame()\Data = #Null
EndIf
Expand Down Expand Up @@ -1321,8 +1318,8 @@ Module WebSocket_Server
EndModule

; IDE Options = PureBasic 5.72 (Windows - x64)
; CursorPosition = 126
; FirstLine = 105
; CursorPosition = 809
; FirstLine = 768
; Folding = ---
; EnableThread
; EnableXP
Expand Down

0 comments on commit 3c9cdb9

Please sign in to comment.