#1 2012-05-28 12:53:07

chapa
Member
Registered: 2012-04-30
Posts: 117

MessageBox

Hi ab,

I used to call interface based services over NamedPipe. Using latest code.

Testing the client/server connection failover, where client and server may be both windows services I break into:
SQLite3Commons, line 18317:
MessageBox(0,pointer(SysErrorMessage(Card)),pointer(fPipeName),0);

Isn't it enough just to log the error or pass the exception to the client?
I think, that no UI modal dialogs have to be shown by the framework, especially at low-level.

Another question:
It is very handy to specify custom service answer, allowing to reply with compressed/binary content and bypass MIME encoding.
Is there an easy, build in the framework, way for the client to send binary content to the server service?

Thanks.

Offline

#2 2012-05-28 13:40:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,192
Website

Re: MessageBox

1. About the message box, you are right.
It was mainly a debugging feature, from the earlier stage of the framework.
See http://synopse.info/fossil/info/5dd3bcaefa

2. In its current state, it can return any binary content directly, and bypass Base64 encoding and JSON serialization.
See http://synopse.info/forum/viewtopic.php?pid=3856#p3856
and http://blog.synopse.info/post/2012/03/2 … ed-service

What you expect is the opposite, right?
How to send binary data to the server?

Very interesting feature - I'll add it.

Offline

#3 2012-05-28 14:57:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,192
Website

Re: MessageBox

About incoming binary blobs, on second thoughts, it won't be possible easily.

The whole implementation pattern expects the incoming request to be a JSON object.
See the documentation about the used JSON layout.

Only exception could be in rmRest kind of routing, with the optional URI decoding (the HTML way).
Unfortunately, this kind of routing is not available with the Delphi clients (will rely on the JSON object, e.g. to handle sicClientDriven instance creation).

So IMHO the easiest is to code your own method-based service, not an interface-based service, for this explicit purpose.
See the corresponding part of the documentation.
You'll have all access to the incoming binary content, and will be able to react as expected.
It is a perfect implementation for handling a HTML POST command, e.g. with an attached file, or to reduce bandwidth.

I'll perhaps implement a similar behavior for interface-based services in the future, but since it is not so relevant in the road map, and since there is already an easy and powerful workaround (use method-based services), I can't give any time indication by now.
But you are free to implement it, and contribute to the project!

Offline

#4 2012-05-28 15:34:18

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,299
Website

Re: MessageBox

For example I'm implement binary data transfer by coding method-based service which take a multipart/form-data request(transfer file from client to server) as described in http://www.ietf.org/rfc/rfc1867.txt but with some limitation.
I use browser as client and this is only way to transfer binary data without base64 encoding (base64 not supported by IE<10).
In case of delphi client everything will be much easier, I think..

Last edited by mpv (2012-05-28 15:35:01)

Offline

#5 2012-05-30 06:55:54

chapa
Member
Registered: 2012-04-30
Posts: 117

Re: MessageBox

Thank you very much for the hints provided.

Currently it is not a big issue for me.
Once I need to communicate over HTTP this will become bottleneck and will be glad to contribute my implementation.

I noticed in LogView application, that some lines are reported with wrong time among others. They had to be chronological.
This leads to wrong time/propertime reports.
If you are not aware of this issue I can provide you with more details and try to look for the problem.

Could someone give me opinion which javascript library prefer/use for rich client of the framework?
jQuery, YUI, or maybe someone other?

Thanks.

Offline

#6 2012-05-30 07:01:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,192
Website

Re: MessageBox

No, I was not aware of this issue in LogView...
Which version of Delphi are you using?
We'll need additional information.

About JavaScript, I suspect all are more or less well designed and known.
Both jQuery and YUI look fine to me - but IMHO the best is to use something like Smart Studio, which enable you to code in Delphi.

Offline

#7 2012-05-30 07:28:52

chapa
Member
Registered: 2012-04-30
Posts: 117

Re: MessageBox

Wow, last time I checked Smart Studio (less than a month I guess) it was alpha and not available for download.
Arriving just in time, will give it a try.

I am using Delphi X2 Upd1, compiled both logging application and LogView.
Where I can send or post the log file and usage description? Maybe an email?

Offline

#8 2012-05-30 08:39:43

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,192
Website

Re: MessageBox

You can send it to webcontact01 at synopse dot info address.

I think I already identified a potential issue with Delphi 2010 and up with the high-resolution timer.
Do you use the TSynLogFamily.HighResolutionTimeStamp setting?

I've modified the code a little bit to check of QueryPerformanceFrequency failure, and rollback to low-resolution timer.
Not sure it will be enough.
See http://synopse.info/fossil/info/354bc0c88d

Offline

#9 2012-05-30 09:53:21

chapa
Member
Registered: 2012-04-30
Posts: 117

Re: MessageBox

Used following Family settings:

    Level := LOG_VERBOSE;
    PerThreadLog := True;
    HighResolutionTimeStamp := True;
    AutoFlushTimeOut := 5;
    OnArchive := EventArchiveSynLZ;
    ArchiveAfterDays := 1;

Will try the new code and report the log to the mail if the problem is still there.
Thanks a lot.

Offline

#10 2012-05-30 11:33:08

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,299
Website

Re: MessageBox

I'm use http://www.sencha.com/ for rich client. Very good framework. But not simple.

Offline

#11 2012-05-31 19:04:39

Junior/RO
Member
Registered: 2011-05-13
Posts: 201

Re: MessageBox

For sencha/ExtJS, I use www.unigui.com, very good Delphi vcl components.

Offline

#12 2012-05-31 19:08:51

array81
Member
From: Italy
Registered: 2010-07-23
Posts: 411

Re: MessageBox

Sencha is a good framework but you cannot use in a close project without buy a license and a lincese is very expensive sad

Offline

#13 2012-06-01 12:57:04

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,299
Website

Re: MessageBox

Where is a free edition http://qooxdoo.org (it's a ExtJS1.0 branch)
But expensive - it's depend... If my project is commercial and a spend 1 month to do something with jQuery or a week with ExtJS I think ExtJS for $500  is better then 3 week of my salary.
If my project is for fun or academic - ExtJS is free in this case.

Offline

Board footer

Powered by FluxBB