Menu

How Clear TCP Socket

Reyan
2024-06-17
2024-07-06
  • Reyan

    Reyan - 2024-06-17

    Hello Dave
    Thank you so much for sharing nice work. We are using snap7 on C++ in Ubuntu 18. I am working on a system that sometimes experience an overload on the network and CPU, and when that happens we have seen old data in TCP socket, so the new reading is actually taken bytes previous read operation. Please is there a way to clear the TCP socket on Client before send a new read request to guarantee no residual is left from previous operation ?

    Thanks
    Reyan

     

    Last edit: Reyan 2024-06-17
  • Piotr Bzdręga

    Piotr Bzdręga - 2024-06-22

    Did you try to close connection and then open again?

     
  • Reyan

    Reyan - 2024-07-04

    Yes, I tried also, seems a just temporary delay in network. I am not sure what to do, I will add a delay time of few seconds, when an error happened, following by close/open, to see if that fix it. So it is only adding delay before close/open again. Thanks

     

    Last edit: Reyan 2024-07-04
  • Piotr Bzdręga

    Piotr Bzdręga - 2024-07-05

    I just wondering what approach does your code take 🤔.
    Are you sending request and waits for result before sending the next one,
    or maybe you asynchronously sending requests and then matches them with results?
    I'm not sure if is it possible in Snap7

     
  • Piotr Bzdręga

    Piotr Bzdręga - 2024-07-06

    btw.
    is that your repository 🤔 .
    If yes, I appended pull request last year (not accepted yet)
    I guess it might be useful for somebody

     

Log in to post a comment.