Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

write error: An established connection was aborted by the software #151

Open
loveyandex opened this issue Feb 12, 2023 · 0 comments
Open

Comments

@loveyandex
Copy link

write tcp4 127.0.0.1:4000->127.0.0.1:24754: wsasend: An established connection was aborted by the software in your host machine.

##problem

when i open browser first time all is ok ...
but by refrreshing it can not be established to connnection and was aborted
no data can be exchanged
the code for websocker stablishing is talking with rabbitmq task queue

code :


app.Get("/ws/:id", websocket.New(func(c *websocket.Conn) {
		 
//this chan for connection alive
		var forever chan string
		  
		Q, err := ch.Consume(
			qqq.Name, // queue
			"",               // consumer
			false,            // auto-ack
			false,            // exclusive
			false,            // no-local
			false,            // no-wait
			nil,              // args
		)

		for d := range Q{
			b := d.Body
			// log.Printf("msg recv: %s", b)

			if err = c.WriteMessage(1, b); err != nil {
				log.Println("orderbooks write:", err)

			}
		}
		<-forever

	}))
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant