LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Telnet connection, want to know when bytes are waiting.

In my program I have a telnet connection with a server. At a certain point in my program I want to check whether there are bytes waiting to be read. Something like
 
bool BytesWaiting(void)
{
  if (ByteAmount >0)
     return true
  else
      return false
}
 
I've searched the telnet library but I only see functions for send/receive, receiveuntil and open/close.
 
Does anyone have a solution for this problem?

Thanks in advance.
0 Kudos
Message 1 of 2
(2,842 Views)
The telnet functions in the CVI Internet library are high-level functions and do not expose the underlying sockets or this kind of low-level functionality. You can try calling the read function with a very small timeout to check if there are bytes to be read - the down-side is that this will cause the bytes to be read if there is data, which may or may not be OK in your case.
0 Kudos
Message 2 of 2
(2,827 Views)