Skip to content

Commit

Permalink
fixup tests, extend readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Witkowski committed Mar 27, 2017
1 parent 428fa1c commit a8f5f87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions proxy/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ func (s *handler) handler(srv interface{}, serverStream grpc.ServerStream) error
if err != nil {
return err
}
// Explicitly *do not close* s2cErrChan and c2sErrChan, otherwise the select below will not terminate.
// Channels do not have to be closed, it is just a control flow mechanism, see
// https://groups.google.com/forum/#!msg/golang-nuts/pZwdYRGxCIk/qpbHxRRPJdUJ
s2cErrChan := s.forwardServerToClient(serverStream, clientStream)
c2sErrChan := s.forwardClientToServer(clientStream, serverStream)
// Explicitly *do not close* s2cErrChan and c2sErrChan, otherwise the select below will not terminate.
// See https://groups.google.com/forum/#!msg/golang-nuts/pZwdYRGxCIk/qpbHxRRPJdUJ

// We don't know which side is going to stop sending first, so we need a select between the two.
for i := 0; i < 2; i++ {
select {
Expand Down
2 changes: 1 addition & 1 deletion proxy/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (s *ProxyHappySuite) SetupSuite() {
s.testClient = pb.NewTestServiceClient(clientConn)
}

func (s *ProxyHappySuite) xTearDownSuite() {
func (s *ProxyHappySuite) TearDownSuite() {
if s.proxy != nil {
s.proxy.Stop()
s.proxyListener.Close()
Expand Down

0 comments on commit a8f5f87

Please sign in to comment.