gowebsocket | golang based on websocket single machine supports millions | Websocket library
kandi X-RAY | gowebsocket Summary
kandi X-RAY | gowebsocket Summary
golang based on websocket single machine supports millions of connections distributed chat (IM) system
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gowebsocket
gowebsocket Key Features
gowebsocket Examples and Code Snippets
Community Discussions
Trending Discussions on gowebsocket
QUESTION
I have the following code which works ok, the issue is that when the socket.Connect()
fails to connect I want to stop the process, I’ve tried with the following code
but it’s not working, I.e. if the socket connect fails to connect the program still runs.
What I want to happen is that if the connect
fails, the process stops and the channe…what am I missing here?
ANSWER
Answered 2019-Jun-20 at 21:42Ok, what is happening is the channel is blocking when you try to add something to it. Try initializing the done
channel with a buffer (I used 1) like this:
done = make(chan bool, 1)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gowebsocket
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page