| // Copyright 2015 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Accept4 wraps syscall.Accept4. |
| func (sw *Switch) Accept4(s, flags int) (ns int, sa syscall.Sockaddr, err error) { |
| return syscall.Accept4(s, flags) |
| f, _ := sw.fltab[FilterAccept] |
| ns, sa, so.Err = syscall.Accept4(s, flags) |
| if err = af.apply(so); err != nil { |
| sw.stats.getLocked(so.Cookie).AcceptFailed++ |
| nso := sw.addLocked(ns, so.Cookie.Family(), so.Cookie.Type(), so.Cookie.Protocol()) |
| sw.stats.getLocked(nso.Cookie).Accepted++ |