#1 Re: mORMot 2 » got a raise when using TSqlDBClientDataSet » 2023-07-04 08:23:01

to assigned a datetype use cast ,Can be regarded as a good idea

#2 Re: mORMot 2 » got a raise when using TSqlDBClientDataSet » 2023-07-04 07:12:08

geting a raise when query empty,but normal when not empty.

#3 Re: mORMot 2 » got a raise when using TSqlDBClientDataSet » 2023-07-04 06:53:39

Above is my project: unigui+rest.
Besides, I hit a pit.  field:Text ,As records added,Sometimes it's a widestring, and later it's a widememo.
IgnoreColumnDataSize  of TSqlDBClientDataSet has no effect.becase using create(AOwner: TComponent)...
so,i changed default value of IgnoreColumnDataSize in mormot.db.rad.ui.sql.pas
...

#4 Re: mORMot 2 » got a raise when using TSqlDBClientDataSet » 2023-07-04 06:36:44

aslite=TSQLModel.Create([
    TSQLAuthor...],'root');
arest=TSQLRestServerDB.create(aslite,filename);
TSqlDBClientDataSet.Connection=TSQLDBSQLite3ConnectionProperties.Create(arest.DB);

#5 mORMot 2 » got a raise when using TSqlDBClientDataSet » 2023-07-04 06:19:21

songshuang
Replies: 5

sql :
  SELECT ''All'' as field1, count(*) as field2,' sum(case when ret=0 then 1 else 0 end) as field3
in this case , will got a raise :
        raise EVirtualDataSet.CreateUtf8('%.GetFieldData ColumnType=%', [self, TSqlDBFieldTypeToString(ColumnType)]);
   (in procedure :InternalInitFieldDefs, mormot.db.rad.ui.sql.pas )
I suggest add :
    ....
        mormot.db.core.ftNull, 
        mormot.db.core.ftUnknown:
          dbtype := ftWideString;
    ....

#6 Re: mORMot 1 » Mqtt server based on mormot's network,give some suggestion pls » 2021-03-06 05:24:31

I'm building on mormot.net.async.pas's network architecture.
The main changed in mormot.net.async.pas is:The function of checking idle put in a single thread. because you put it to after ProcessWrite(30000) line,when a client is onlie ,Checking idle function will happen per 30 sec.
When a client accepted,will create a connction and fClients.Start(connection) at once.
I founded that error will be occurred when active close a connection
My code is:

procedure TAsyncConnections.IdleEverySecond;
...
  fConnectionLock.Lock;
  try
    for i:=0 to fConnectionCount-1 do
    begin
      aconn := fConnection[i];
      allowed := UnixTimeUtc - aconn.fCanIdleLen;
      if aconn.fLastOperation < allowed then
      begin
        IdleArr.Add(aconn.handle);
...
  for i:=0 to High(IntegerArr) do
    ConnectionRemove(IntegerArr[i]);
end;

Now the following error can occurred(under about 250 wifi's-thermostats connections,ubuntu)

EXCOS EAccessViolation (04) [MQTTSvrTAConnectionspseRead] at 6d8036 ../../SysDataManager/mORMot2/src/net/mormot.net.sock.posix.inc tpollsocketepoll.waitformodified (655) ../../SysDataManager/mORMot2/src/net/mormot.net.sock.pas pollandsearchwithinpending (1513) ../../SysDataManager/mORMot2/src/net/mormot.net.sock.pas tpollsockets.getone (1556) src/MqttServer/mormot.net.async_rw.pas tpollasyncsockets.processread (652) src/MqttServer/mormot.net.async_rw.pas tasyncconnectionsthread.execute (904) 
EXC   EInvalidCast {Message:"Invalid type cast"} [MQTTSvrTAConnectionspseRead] at 617b04 src/MqttServer/mormot.net.async_rw.pas tasyncconnectionssockets.onclose (816) src/MqttServer/mormot.net.async_rw.pas closeconnection (639) src/MqttServer/mormot.net.async_rw.pas tpollasyncsockets.processread (684) src/MqttServer/mormot.net.async_rw.pas tasyncconnectionsthread.execute (904) 

No error founded on windows ,when one or two client connected.
I try to do in version 1.18 or 2,the above error will happen aslo.
How to active close a coneection?Please help me or some suggestions.

#7 Re: mORMot 1 » Mqtt server based on mormot's network,give some suggestion pls » 2021-02-24 13:44:26

Please give me some suggestions!
pls see https://github.com/songshuang8/MqttServer, login,sub,unsub ,pub , ping, is ok. no retain!
based on rtsphttp.pas

#8 Re: mORMot 1 » Mqtt server based on mormot's network,give some suggestion pls » 2021-02-07 07:05:03

client is not inerested to me,it's be realized by wifi's chip normal.:)

#9 Re: mORMot 1 » Mqtt server based on mormot's network,give some suggestion pls » 2021-02-07 05:57:10

What I care is the maximum number of connections,
because mqtt is long term connection,I noticed that acceped is served by TSynThreadPoolSubThread. a keeplived connected client is served by THttpServerResp. THttpServerResp is a thread , means a clent is a thread.
I noticed that THttpServerResp is asynchronous wating for received:pending := fServerSock.SockReceivePending(50); ....
I am thinking:
how many threads in a server?
many many client served by a thread pool? how to readlin?
The frame of the network serverd many client is my noticed!
mqtt's protocol is simple to me.
mormot's interface is complex to me smile
based frame units:https://github.com/songshuang8/MqttServer,now is nothing but MqttServer.pas
i want to:sqlite is serverd by saving persistent mqtts message, rest is serving manager api,log is loging...

#10 mORMot 1 » Mqtt server based on mormot's network,give some suggestion pls » 2021-02-06 12:14:39

songshuang
Replies: 10

rewrite the unit mormot.net.http or TRestHttpServer?
i am learning the demo :websocket. i try to study the framework of websockt.
please give some suggestions!

#11 Re: mORMot 1 » "ECrtSocket ("SndLow()" Err Founded » 2020-08-31 05:31:28

Wear a hat,its ok.
use nginx as a shield,It's working smile

#12 mORMot 1 » crashed when coding by delphi7 uses the unit SynCommons.pas » 2020-04-11 01:01:30

songshuang
Replies: 3

the mORMot version is trunk. i think SynCommons.pas  size is too big?  :)

#13 Re: mORMot 1 » "ECrtSocket ("SndLow()" Err Founded » 2020-04-11 00:51:29

the project is based on sample 30 mvc server. so the static file is published no any "user's" code.
get the static file by the url ,is http://ip/root/static/keysData.rif. i get the file use chrome browser, the progress getting the static file is: 0% go 16%, then turn to 0% repeatly, i think chrome try on get this. After this cycle was repeated a few times,chrome show error.
yes, sending of a static files use nginx is a good idea.
thank you



i found the problem also, when Ctxt.Returns('....[long size string,got by database record ]...').   client show the err: the content-lenth is more than received.
Other factors is that the network is poor! network bandwidth is 2M only.  client is in china and server is in germany. smile

#14 mORMot 1 » "ECrtSocket ("SndLow()" Err Founded » 2020-04-10 06:35:29

songshuang
Replies: 4

Hello,
i has a project in  2019.3; ECrtSocket ("SndLow() error is founded today when client get a static file ,the file is 1.8MB abount.
logs is showing:
20200410 14155759  +    admin.TSsAdminServer(7f506ccdab10).URI GET root/static/keysData.rif in=0 B
20200410 14155760  -    00.012.987
20200410 14161760 EXC   ECrtSocket ("SndLow() len=1485666 [11 WSATRY_AGAIN Try again]") [TssHTTPSvr 65500/remotedata3 root PoolSub] at 52ea99 52e9cf 534308 53389d 53862f 537ed0 53804d
so i update newest mormot source , but the errer as before.
the environment is buntu 16.04.6 LTS (GNU/Linux 4.4.0-166-generic x86_64)
Number of files received by the client is 16% abount,then error happend.
thanks for help.

#15 Re: mORMot 1 » about IdemPChar function » 2018-08-10 15:15:20

others,
the amount of pascal user  is A little pitiful!,  i m shy to say  i m older psacal hands!,but but...
the pascal is wonderful because have mORMOT!
mOrMot is great!.

#18 mORMot 1 » about IdemPChar function » 2018-08-09 18:33:35

songshuang
Replies: 4

if IdemPChar(pointer(Ctxt.URL),'abc') then
.....
but always return false?
same response  on windows both linux .

Board footer

Powered by FluxBB