Github user cherrot commented on the pull request:

    https://github.com/apache/thrift/pull/945#issuecomment-199073494
  
    A try-except block is surely needed when we do something relative to the 
physical world, but we are not discussing on that, right?
    
    >It's perfectly possible without modifying Thrift: just store TSocket 
instance and use its handle attribute.
    
    Yes it is possible, but far from perfect:  the `TSocket` object is 
initialized as a parameter for initializing the `TTransport` instance. Since 
`TTransport` does not want me to access the `TSocket` object from it, I have no 
responsibility to maintain the socket's state.
    
    Furthermore, if this is not the approach you prefer, then why is there a 
`peek` method in C++ lib? If it can be used in the logic of the server side, it 
can surely be used in the client side.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to