zhangmeng
2019-08-26 3bd1f29975c0eaa6af8c99776b099faafbbfc250
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2016 Tom Thorogood. All rights reserved.
// Use of this source code is governed by a
// Modified BSD License license that can be found in
// the LICENSE file.
 
package net
 
import (
    "net"
    "sync"
    "time"
 
    "github.com/tmthrgd/shm-go"
)
 
type Conn struct {
    *shm.ReadWriteCloser
    name string
 
    mut *sync.Mutex
}
 
func (c *Conn) Close() error {
    c.mut.Unlock()
    return nil
}
 
func (c *Conn) LocalAddr() net.Addr {
    return addr(c.name)
}
 
func (c *Conn) RemoteAddr() net.Addr {
    return addr(c.name)
}
 
func (c *Conn) SetDeadline(t time.Time) error {
    return nil
}
 
func (c *Conn) SetReadDeadline(t time.Time) error {
    return nil
}
 
func (c *Conn) SetWriteDeadline(t time.Time) error {
    return nil
}