Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fish-tennis committed Mar 14, 2024
1 parent a0f8d78 commit 3a7ef2b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ Layer2:Decoding the data from Layer1,such as decryption,decompression,etc

Layer3:protobuf deserialize,generate proto.Message

![length & data](https://github.com/fish-tennis/doc/blob/master/imgs/gnet/packet.png)

![encode](https://github.com/fish-tennis/doc/blob/master/imgs/gnet/packet_encode.png)

![decode](https://github.com/fish-tennis/doc/blob/master/imgs/gnet/packet_decode.png)

### Handler(https://github.com/fish-tennis/gnet/blob/main/handler.go)

ListenerHandler:when the server accept a new connection or the accepted connection disconnected
Expand All @@ -72,6 +78,14 @@ func OnTest(conn Connection, packet Packet) {
}
```

### Use RingBuffer to increase performance

![decode](https://github.com/fish-tennis/doc/blob/master/imgs/gnet/ringbuffer-performance.png)

### goroutine

![connection_goroutine](https://github.com/fish-tennis/doc/blob/master/imgs/gnet/connection_goroutine.png)

## Examples

[echo with protobuf](https://github.com/fish-tennis/gnet/blob/main/echo_proto_test.go)
Expand Down

0 comments on commit 3a7ef2b

Please sign in to comment.