Skip to content

Commit a8f5f87

Browse files
author
Michal Witkowski
committed
fixup tests, extend readme
1 parent 428fa1c commit a8f5f87

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

proxy/handler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ func (s *handler) handler(srv interface{}, serverStream grpc.ServerStream) error
7575
if err != nil {
7676
return err
7777
}
78+
// Explicitly *do not close* s2cErrChan and c2sErrChan, otherwise the select below will not terminate.
79+
// Channels do not have to be closed, it is just a control flow mechanism, see
80+
// https://groups.google.com/forum/#!msg/golang-nuts/pZwdYRGxCIk/qpbHxRRPJdUJ
7881
s2cErrChan := s.forwardServerToClient(serverStream, clientStream)
7982
c2sErrChan := s.forwardClientToServer(clientStream, serverStream)
80-
// Explicitly *do not close* s2cErrChan and c2sErrChan, otherwise the select below will not terminate.
81-
// See https://groups.google.com/forum/#!msg/golang-nuts/pZwdYRGxCIk/qpbHxRRPJdUJ
82-
8383
// We don't know which side is going to stop sending first, so we need a select between the two.
8484
for i := 0; i < 2; i++ {
8585
select {

proxy/handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func (s *ProxyHappySuite) SetupSuite() {
236236
s.testClient = pb.NewTestServiceClient(clientConn)
237237
}
238238

239-
func (s *ProxyHappySuite) xTearDownSuite() {
239+
func (s *ProxyHappySuite) TearDownSuite() {
240240
if s.proxy != nil {
241241
s.proxy.Stop()
242242
s.proxyListener.Close()

0 commit comments

Comments
 (0)