Closed hiqsociety closed 3 years ago
Your best bet is to listen on both sockets in different goroutines first and share the same handler
package main
import (
"os"
"github.com/tidwall/redcon"
)
func main() {
go func() {
panic(redcon.ListenAndServeNetwork("tcp", ":6380",
handler, accept, close))
}()
go func() {
os.RemoveAll("my-unix-path")
panic(redcon.ListenAndServeNetwork("unix", "my-unix-path",
handler, accept, close))
}()
println("* Serving on port 6380 and on socket my-unix-path")
select {}
}
func handler(conn redcon.Conn, cmd redcon.Command) {
}
func accept(conn redcon.Conn) bool {
return true
}
func close(conn redcon.Conn, err error) {
}
I'm closing this issue for now. Please feel free to reopen if you have further questions.
with reference to this: https://github.com/tidwall/redcon/issues/21
How can it be done? I know one or the other but not both.
Thank you for redcon. It's truly amazing.