#1 Re: mORMot 2 » Console project deadlock » 2024-11-18 00:26:55

The above issues is well sometimes,sometimes occured.

  Writeln('hello word');
  myhttpsvr := TTmyServer.Create;
  try
    Writeln('Press enter to close');
    ConsoleWaitForEnterKey;
  finally
    Writeln('stopping...');
    FreeAndNil(myhttpsvr);
    Writeln('svr stoppeded.');
  end;

Sometimes showing

hello word
Press enter to close
...
20241118 08131854  +    mormot.db.raw.sqlite3.TSqlDatabase(e741f0).DBOpen SQLCY.db
...

Sometimes showing

...
20241118 08233147 http  mormot.rest.http.server.TRestHttpServer(02f2a2e0) http.sys registration of http://+:7302//
hello word
Press enter to close

so, I may have some understanding now

#2 mORMot 2 » Console project deadlock » 2024-11-16 09:05:53

songshuang
Replies: 3

hello!
I have a little console project rest server with mormot2,  it can be deadlock some times(no any response when client connecting), it is good when keying enter key,What could be the possible reason?
I make source to service project , It's well.
No any waiting a key in my source.
Mormot 2.3, Delphi12.2

#3 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

#4 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.

#5 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
...

#6 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);

#7 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;
    ....

#8 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.

#9 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

#10 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.:)

#11 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...

#12 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!

#13 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

#14 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?  :)

#15 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

#16 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.

#17 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!.

#20 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