socket question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hg

    #1

    socket question

    Hi,

    I am not sure whether this is a python-related question.

    If I have device A than sends XX bytes to device B, and device B does a
    recv(XX) using the default timeout, what could make device B wake-up
    with less than XX bytes received ?

    Regards,

    hg
  • Diez B. Roggisch

    #2
    Re: socket question

    hg wrote:
    Hi,
    >
    I am not sure whether this is a python-related question.
    >
    If I have device A than sends XX bytes to device B, and device B does a
    recv(XX) using the default timeout, what could make device B wake-up
    with less than XX bytes received ?
    There exist higher abstractions for sockets in python for IPC - are you sure
    you want to reinvent the wheel?

    If you absolutely must: the select-call allows for specification of a
    timeout. Use it with the socket file-descriptor.

    Diez

    Comment

    • hg

      #3
      Re: socket question

      Diez B. Roggisch wrote:
      hg wrote:
      >
      >Hi,
      >>
      >I am not sure whether this is a python-related question.
      >>
      >If I have device A than sends XX bytes to device B, and device B does a
      >recv(XX) using the default timeout, what could make device B wake-up
      >with less than XX bytes received ?
      >
      There exist higher abstractions for sockets in python for IPC - are you sure
      you want to reinvent the wheel?
      >
      If you absolutely must: the select-call allows for specification of a
      timeout. Use it with the socket file-descriptor.
      >
      Diez
      Thanks I'll look, with the retry-wrapper around recv, it seem to work now.

      hg

      Comment

      Working...