I know Control func and syscall.SetsockoptInt(fd, syscall.AF_INET,
syscall.SO_REUSEADDR, 1)  cat set reuseadd
But how to adjust listen backlog since i never find socket options for it.

Agniva De Sarker <agniva.quicksil...@gmail.com> 于2019年3月22日周五 下午4:44写道:

> Using ListenConfig is the way to go.
>
> The Control func is passed the raw socket connection on which you can
> apply whatever socket options you choose. You have to go through 2 layers
> to get to the fd.
>
> ListenConfig{
>  Control: func(conn syscall.RawConn) error {
>    return conn.Control(func(fd uintptr) error {
>      return syscall.SetsockoptInt(fd, syscall.AF_INET, 0, 0)
>    })
>   }
> }
>
>
> On Thursday, 21 March 2019 20:49:20 UTC+5:30, Peter Wang wrote:
>>
>> I try to use net.ListenConfig, but fail
>> can someone give example ?
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to