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