Jump to content

Rav

Members
  • Posts

    89
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Rav

  1. Hello, I see that the "Default" and "Cancel" properties exist in the TUniButton, but cannot understand how to make them work, looks like they don't react to pressed "Enter" and "Escape". Ravil
  2. Thanks for tips. Sorry, I don't quite understand, you mean that a memory table can be accessed by both the server and the client, right? Is the UniGUIMainModule designed for this purpose?
  3. The data I am showing in the ListViews are fluent, change rapidly and are not located in the database, only in server's RAM. Do you think that UniDBGrid is the best component for showing such data?
  4. Hello, I am using a lot of VCL virtual ListView controls with "OwnerData = True". Looks like UniGui doesn't have UniListView component, just UniStringGrid. How to work with it properly if there are 100-200 thousands of records?
  5. Yes I tested idTCPClient, it works fine, thank you! Then I decided to try idTCPServer on the client side and tested the code: procedure TMainForm.UniFormCreate(Sender: TObject); begin idServer := TIdTCPServer.Create; idServer.OnExecute := idServerExecute; idServer.DefaultPort := 12345; idServer.Active := True; UniLabel2.Caption := 'Test';//Works fine end; procedure TMainForm.idServerExecute(AContext: TIdContext); var i: integer; begin with AContext.Connection.Socket do try i := ReadLongint; UniLabel2.Caption := inttostr(i);//Exception except end; end; This code gives an exception "Attempt to access nil session reference" while referencing UniLabel2. Why is that? I guess this relates to the fact that idServerExecute is executed by Indy in a thread, but why "session is nil"? And another question, VCL components are not thread safe, is the situation the same with UniGui controls?
  6. I think it's the best way It's too modern way It's too complicated way. Suppose I use TUniTimer. Sorry for the following stupid questions, but there is no UniGui documentation and "all features demo" app didn't clear up the situation either. 1) How to send a message (Delphi record) from a client to the server? I found a code sample: UniSession.SendResponse('New Text', False) Is it the way how the client sends a text message to the server? 2) How should the server handle it? If found OnHTTPCommand event handler. Is that it? 3) How to send a Delphi record from a client to the server? UniSession.SendStream? 4)How should the server handle incoming stream? There is no OnStream event handler. 5)How should the client retrieve new data from the server? I don't use databases. All data are in the server's memory. As I said I could not find a simple example which shows how to organize this client-server functionality properly.
  7. On the client side the events are triggered by interacting with controls. On the server side the events are triggered internally, without human intervention. In other words the clients display some server info and can modify some server parameters remotely. When the server parameter is changed (it could be also done due to other internal reasons) the server sends a message (delphi record) to all clients, they receive it and update the display info accordingly. Now this scheme works using TidTCPClient+TidTCPServer components bundle on the clients and the server (TidTCPClient sends a message, TidTCPServer handles received messages). I want to move from VCL to UniGui and use http for exchanging messages.
  8. Hello, I have two apps, a client VCL app and a server none-VCL app which work together exchanging data using TidTCPClient and TidTCPServer components on both sides. If one side wants to change the other it sends data in a way like this: with TidTCPClient.Create do try try Host := 'localhost'; Port := 1234; ReadTimeout := 2000; Connect; with Socket do begin write(integer(1)); end; Disconnect; except end; finally Free; end; It works simple and reliable. How to properly organize this two way communication using UniGui? Which components should I use?
×
×
  • Create New...