VServer questions -- NOTE 1.

Charles Yeomans charles at declareSub.com
Tue Dec 12 12:20:12 CST 2006


On Dec 12, 2006, at 4:38 AM, Ruslan Zasukhin wrote:

> On 12/12/06 11:30 AM, "Ivan Smahin" <IvanSmahin at public.kherson.ua>  
> wrote:
>
> Hi Charles,
> Hi All,
>
>> CY> Once you've established a connection to a VServer from a V4Rb  
>> client
>> CY> and opened a database using the connection,  
>> VConnection.IsConnected
>> CY> returns true, and VDatabase.IsOpen returns true.  But what  
>> happens
>> CY> when, say, the server shuts down?  It turns out that  
>> IsConnected and
>> CY> IsOpen still return true.  So there doesn't appear to be a way to
>> CY> determine whether a connection is actually working other than  
>> to try
>> CY> something.
>>
>> Well,   just   for   now  we  have  "client-driven"  system.  So  
>> every
>> activity in the server is result of some command issued by the  
>> client.
>> I  mean  there  is  no  client-callbacks  registered in the  
>> server. So
>> server  is  not able to issue some broadcast message like "I'm  
>> turning
>> off".  We don't use this way because it means multi-threaded  
>> vclient -
>> it is not suitable for some our plugins.
>>
>> Now  I  will  try  to  improve connection.IsOpen() method checking  
>> the
>> socket  state,  but  you  know  -  it could be wrong result  
>> because of
>> socket nature. So it is always good idea to catch "network  
>> exceptions"
>> everywhere.
>
>> CY> But if the server has quit, the result is not so good.
>> CY> When I attempt to close a VDatabase object in this situation,  
>> I get
>> CY> VException &h6050a, ERR_STREAM_READ_ERROR. Then the app quits
>> CY> abruptly with only this entry in the console log.
>>
>> CY> terminate called after throwing an instance of  
>> 'fbl::xStreamError'
>>
>> Do you catch this exception in RB? If so - why you get abort?

Because it looks like V4Rb is killing the application.  The console  
message suggests that a C++ exception is not being caught inside  
Valentina.

>
> What Ivan says is:
>
> * when server gone, client computer still do not have info about this.
>
>    OS (mac and win) - still not close socket on client computer  
> some time.
>    can be up to 2 minutes it seems.
>
>    So IsOpen() still answer true.
>
>     for now we think this is the only correct behavior and you
>     MUST live with this.
>
>
> * Next, we do not see say you say: " Then the app quits abruptly "
>
>     you have got exception from Valentina about ERR_STREAM_READ_ERROR?
>     so what problems?

The problem, as I said, is that the application quits after catching  
the exception.  The console log recorded the message provided above.

>
>     of course you will get troubles if you will continue
>     to use dead objects!

  I don't get a chance to reuse dead objects because the application  
quits after catching the exception.

Charles Yeomans


More information about the Valentina mailing list