Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
81efe5bd
Commit
81efe5bd
authored
Jun 14, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9f51b6d7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
go/xcommon/xnet/pipenet/pipenet.go
go/xcommon/xnet/pipenet/pipenet.go
+5
-5
No files found.
go/xcommon/xnet/pipenet/pipenet.go
View file @
81efe5bd
...
@@ -101,6 +101,7 @@ type socket struct {
...
@@ -101,6 +101,7 @@ type socket struct {
// conn represents one endpoint of connection created under Network
// conn represents one endpoint of connection created under Network
type
conn
struct
{
type
conn
struct
{
socket
*
socket
socket
*
socket
peersk
*
socket
// the other side of this connection
net
.
Conn
net
.
Conn
...
@@ -268,8 +269,8 @@ func (l *listener) Accept() (net.Conn, error) {
...
@@ -268,8 +269,8 @@ func (l *listener) Accept() (net.Conn, error) {
skc
:=
req
.
from
.
allocFreeSocket
()
skc
:=
req
.
from
.
allocFreeSocket
()
sks
:=
h
.
allocFreeSocket
()
sks
:=
h
.
allocFreeSocket
()
skc
.
conn
=
&
conn
{
socket
:
skc
,
Conn
:
pc
}
skc
.
conn
=
&
conn
{
socket
:
skc
,
peersk
:
sks
,
Conn
:
pc
}
sks
.
conn
=
&
conn
{
socket
:
sks
,
Conn
:
ps
}
sks
.
conn
=
&
conn
{
socket
:
sks
,
peersk
:
skc
,
Conn
:
ps
}
n
.
mu
.
Unlock
()
n
.
mu
.
Unlock
()
...
@@ -338,8 +339,7 @@ func (c *conn) Close() (err error) {
...
@@ -338,8 +339,7 @@ func (c *conn) Close() (err error) {
n
.
mu
.
Lock
()
n
.
mu
.
Lock
()
defer
n
.
mu
.
Unlock
()
defer
n
.
mu
.
Unlock
()
h
.
socketv
[
sk
.
port
]
=
nil
sk
.
conn
=
nil
if
sk
.
empty
()
{
if
sk
.
empty
()
{
h
.
socketv
[
sk
.
port
]
=
nil
h
.
socketv
[
sk
.
port
]
=
nil
}
}
...
@@ -355,7 +355,7 @@ func (c *conn) LocalAddr() net.Addr {
...
@@ -355,7 +355,7 @@ func (c *conn) LocalAddr() net.Addr {
// RemoteAddr returns address of remote end of connection
// RemoteAddr returns address of remote end of connection
func
(
c
*
conn
)
RemoteAddr
()
net
.
Addr
{
func
(
c
*
conn
)
RemoteAddr
()
net
.
Addr
{
return
c
.
socket
.
addr
()
// FIXME -> must be addr of remote socket
return
c
.
peersk
.
addr
()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment