good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
websocket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
websocket
Commits
8c54bd9b
Unverified
Commit
8c54bd9b
authored
Sep 22, 2019
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
Allow concurrent access NetConn wrapper reading
Updates #88
parent
a5ecad74
Branches
Branches containing commit
Tags
Tags containing commit
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
netconn.go
+6
-1
6 additions, 1 deletion
netconn.go
with
6 additions
and
1 deletion
netconn.go
+
6
−
1
View file @
8c54bd9b
...
...
@@ -7,6 +7,7 @@ import (
"io"
"math"
"net"
"sync"
"sync/atomic"
"time"
)
...
...
@@ -69,8 +70,9 @@ type netConn struct {
readTimer
*
time
.
Timer
readContext
context
.
Context
eofed
bool
readMu
sync
.
Mutex
eofed
bool
reader
io
.
Reader
}
...
...
@@ -89,6 +91,9 @@ func (c *netConn) Write(p []byte) (int, error) {
}
func
(
c
*
netConn
)
Read
(
p
[]
byte
)
(
int
,
error
)
{
c
.
readMu
.
Lock
()
defer
c
.
readMu
.
Unlock
()
if
c
.
eofed
{
return
0
,
io
.
EOF
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment