tidwall / evio

Fast event-loop networking for Go
MIT License
5.88k stars 491 forks source link

How to limit the maximum number of connections ? #56

Open pigochu opened 5 years ago

pigochu commented 5 years ago

I want to implement a proxy program.

A = evio B = backend service

The client will connect to A , and A read data from B then out data to A

If B's max connections is 10. and clients is more than 10 In event.Opened , I use time.Sleep to wait B finish the work , but evio looks like blocked.

So how do I implement it ? or any options can set max connections and backlog ?

cheng-zhongliang commented 1 year ago

When Open event on, return CLOSE action.