Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
57a86cd5
Commit
57a86cd5
authored
Jul 17, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
547a6fa9
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
29 deletions
+33
-29
go/neo/connection.go
go/neo/connection.go
+26
-26
go/neo/proto-str.go
go/neo/proto-str.go
+1
-1
go/neo/proto.go
go/neo/proto.go
+1
-1
go/neo/protogen.go
go/neo/protogen.go
+2
-0
go/neo/zproto-marshal.go
go/neo/zproto-marshal.go
+2
-0
go/neo/zproto-str.go
go/neo/zproto-str.go
+1
-1
No files found.
go/neo/connection.go
View file @
57a86cd5
...
@@ -122,7 +122,7 @@ const (
...
@@ -122,7 +122,7 @@ const (
LinkClient
// link created as client
LinkClient
// link created as client
// for testing:
// for testing:
linkNoRecvSend
LinkRole
=
1
<<
16
// do not spawn serveRecv & serveSend
linkNoRecvSend
LinkRole
=
1
<<
16
// do not spawn serveRecv & serveSend
linkFlagsMask
LinkRole
=
(
1
<<
32
-
1
)
<<
16
linkFlagsMask
LinkRole
=
(
1
<<
32
-
1
)
<<
16
)
)
...
@@ -148,7 +148,7 @@ const (
...
@@ -148,7 +148,7 @@ const (
func
newNodeLink
(
conn
net
.
Conn
,
role
LinkRole
)
*
NodeLink
{
func
newNodeLink
(
conn
net
.
Conn
,
role
LinkRole
)
*
NodeLink
{
var
nextConnId
uint32
var
nextConnId
uint32
var
acceptq
chan
*
Conn
var
acceptq
chan
*
Conn
switch
role
&^
linkFlagsMask
{
switch
role
&^
linkFlagsMask
{
case
LinkServer
:
case
LinkServer
:
nextConnId
=
0
// all initiated by us connId will be even
nextConnId
=
0
// all initiated by us connId will be even
acceptq
=
make
(
chan
*
Conn
)
// accept queue; TODO use backlog
acceptq
=
make
(
chan
*
Conn
)
// accept queue; TODO use backlog
...
@@ -776,7 +776,7 @@ func (c *Conn) Send(msg Msg) error {
...
@@ -776,7 +776,7 @@ func (c *Conn) Send(msg Msg) error {
traceConnSendPre
(
c
,
msg
)
traceConnSendPre
(
c
,
msg
)
l
:=
msg
.
NEOMsgEncodedLen
()
l
:=
msg
.
NEOMsgEncodedLen
()
buf
:=
PktBuf
{
make
([]
byte
,
PktHeadLen
+
l
)}
// TODO -> freelist
buf
:=
PktBuf
{
make
([]
byte
,
PktHeadLen
+
l
)}
// TODO -> freelist
h
:=
buf
.
Header
()
h
:=
buf
.
Header
()
// h.ConnId will be set by conn.Send
// h.ConnId will be set by conn.Send
...
...
go/neo/proto-str.go
View file @
57a86cd5
//go:generate stringer -output
proto-str2
.go -type ErrorCode,NodeType proto.go
//go:generate stringer -output
zproto-str
.go -type ErrorCode,NodeType proto.go
package
neo
package
neo
...
...
go/neo/proto.go
View file @
57a86cd5
//go:generate sh -c "go run protogen.go >proto-marshal.go"
//go:generate sh -c "go run protogen.go >
z
proto-marshal.go"
package
neo
package
neo
// protocol definition
// protocol definition
...
...
go/neo/protogen.go
View file @
57a86cd5
...
@@ -180,6 +180,8 @@ func main() {
...
@@ -180,6 +180,8 @@ func main() {
buf
.
emit
(
`// Code generated by protogen.go; DO NOT EDIT.
buf
.
emit
(
`// Code generated by protogen.go; DO NOT EDIT.
package neo
package neo
// protocol messages to/from wire marshalling.
import (
import (
"encoding/binary"
"encoding/binary"
"reflect"
"reflect"
...
...
go/neo/proto-marshal.go
→
go/neo/
z
proto-marshal.go
View file @
57a86cd5
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
package
neo
package
neo
// protocol messages to/from wire marshalling.
import
(
import
(
"encoding/binary"
"encoding/binary"
"reflect"
"reflect"
...
...
go/neo/
proto-str2
.go
→
go/neo/
zproto-str
.go
View file @
57a86cd5
// Code generated by "stringer -output
proto-str2
.go -type ErrorCode,NodeType proto.go"; DO NOT EDIT.
// Code generated by "stringer -output
zproto-str
.go -type ErrorCode,NodeType proto.go"; DO NOT EDIT.
package
neo
package
neo
...
...
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