bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Socket::isPending(pendingInput, timeout) is blocking


From: Federico Montesino Pouzols
Subject: Re: Socket::isPending(pendingInput, timeout) is blocking
Date: Tue, 3 Sep 2002 00:21:10 +0200
User-agent: Mutt/1.4i

On Mon, Sep 02, 2002 at 11:54:37PM +0200, triendl klaus wrote:
> hi everybody,
> 
> i have a question to Socket::isPending(enPending, timeout).
>
>
>
> according to the signature of this method it should be possible to
>tell this method to end after a certain time period if no data comes
>in anymore even if data is expected to come.

        You are right, the second parameter of isPending is the
maximum time to wait for the kind of event given in the first
parameter. 

        It is weird that method does not work for you, since it is a
very widely used method and has been around for a lot of time. Try the
following simple test:

---
  TCPStream str("127.0.0.1",2401);    // put an accepting tcp port on 2401
  if ( str.isPending(Socket::pendingInput,5000) )
    cout << "true" << endl;
  else
    cout << "false" << endl;
---

        If it waits 5 and says "false", isPending works as
expected. If not, there must be something very weird on your system.

        There is also a 'tcpstream' class in CC++ that may interest
you.

        Bye!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]