OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [net/] [sock_windows.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2009 The Go Authors.  All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
// Sockets for Windows
6
 
7
package net
8
 
9
import "syscall"
10
 
11
func maxListenerBacklog() int {
12
        // TODO: Implement this
13
        return syscall.SOMAXCONN
14
}
15
 
16
func listenerSockaddr(s syscall.Handle, f int, la syscall.Sockaddr, toAddr func(syscall.Sockaddr) Addr) (syscall.Sockaddr, error) {
17
        a := toAddr(la)
18
        if a == nil {
19
                return la, nil
20
        }
21
        switch v := a.(type) {
22
        case *UDPAddr:
23
                if v.IP.IsMulticast() {
24
                        err := setDefaultMulticastSockopts(s)
25
                        if err != nil {
26
                                return nil, err
27
                        }
28
                        switch f {
29
                        case syscall.AF_INET:
30
                                v.IP = IPv4zero
31
                        case syscall.AF_INET6:
32
                                v.IP = IPv6unspecified
33
                        }
34
                        return v.sockaddr(f)
35
                }
36
        }
37
        return la, nil
38
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.