locked
get data from server using Tcp socket within 10 sec else retry RRS feed

  • Question

  • Developing window store app where client needs to get information from server using request -response messages over Tcp socket. Client fires next request message only after successful reception of previous request's response . i want to incorporate a maximum response waiting time of 10 second.Response message received after 10 sec will be discarded or have no effect.I have established a Tcp socket connection between server and client ,but don't know how to implement the above scenario. i was thinking of attaching some event handler which will be invoked on completion of 10 second with bool value = false, indicating  failure in response receive . Is this is the most appropriate way of solving above problem . If yes , then please explain the procedure ( using pseudo code / real code will be appreciated)  . If not, then tell me the proper way .
    Thanks

    • Edited by Satyabrat kumar Thursday, February 6, 2014 4:48 PM spelling mistake
    Thursday, February 6, 2014 2:28 PM

Answers

  • Hi Satyabrat,

    Take a look at this: How to set timeouts on socket operations

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, February 7, 2014 9:37 AM
    Moderator

All replies

  • Hi Satyabrat,

    Take a look at this: How to set timeouts on socket operations

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, February 7, 2014 9:37 AM
    Moderator
  • Thanks James
    Friday, February 7, 2014 10:24 AM