Add Connection Timeout #24

Closed
opened 2024-11-06 14:34:34 +00:00 by smark · 3 comments
Owner

Veränderungen des Routings, zb durch VPN, müssen behandelt werden.

Veränderungen des Routings, zb durch VPN, müssen behandelt werden.
Author
Owner
https://pkg.go.dev/github.com/gorilla/websocket@v1.5.3#Conn.SetReadDeadline
Author
Owner
index 4aeb6ad..3cc00f1 100644
--- a/internal/websocket/receive.go
+++ b/internal/websocket/receive.go
@@ -19,6 +19,7 @@ func (c *Client) ProcessServerMessages(channel chan<- GoTomato.ServerMessage) {
 	defer close(Done)
 
 	for {
+		c.Conn.SetReadDeadline(time.Now().Add(10 * time.Second))
 		_, message, err := c.Conn.ReadMessage()
 		if err != nil {
 			// On normal closure exit gracefully
```diff index 4aeb6ad..3cc00f1 100644 --- a/internal/websocket/receive.go +++ b/internal/websocket/receive.go @@ -19,6 +19,7 @@ func (c *Client) ProcessServerMessages(channel chan<- GoTomato.ServerMessage) { defer close(Done) for { + c.Conn.SetReadDeadline(time.Now().Add(10 * time.Second)) _, message, err := c.Conn.ReadMessage() if err != nil { // On normal closure exit gracefully ```
Author
Owner

closed by 9de86fc

closed by 9de86fc
smark closed this issue 2024-11-13 18:48:46 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: pomodoro/ChronoTomato#24
No description provided.