joao-r-reis commented on code in PR #1822:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1822#discussion_r1810925338


##########
conn.go:
##########
@@ -694,7 +718,7 @@ func (c *Conn) recv(ctx context.Context) error {
        } else if head.stream == -1 {
                // TODO: handle cassandra event frames, we shouldnt get any 
currently
                framer := newFramer(c.compressor, c.version)
-               if err := framer.readFrame(c, &head); err != nil {
+               if err := framer.readFrame(r, &head); err != nil {
                        return err
                }
                go c.session.handleEvent(framer)

Review Comment:
   I like the implementation you linked 👍 .
   
   > The only thing I don't like here is that 
[calling](https://github.com/worryg0d/gocql/blob/bc29d6e491e75fd72f0c77445151dc117d62ac02/conn.go#L567C1-L569C2)
 Close() on the r actually closes the whole net.Conn. We should probably move 
contextWriter from Conn to the wrapper as well...
   
   Hmm this is the existing behavior though right? I'm focused mostly on 
keeping the same behavior with this refactoring unless there's something that 
we know for sure is incorrect. In this case I think closing the whole 
`net.Conn` in `close()` is fine, there's a check when writing to see if the 
connection is closed or not. 
   
   One thing we can do is remove the lower case `Conn.close()` because at the 
moment we have a `Conn.Close()` and a `Conn.close()`. The lower case one is 
just confusing, the `Conn.Close()` function should just call 
`connReader.Close()` directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to