Jump to content

JIMSMITH

Members
  • Content Count

    54
  • Joined

  • Last visited

Everything posted by JIMSMITH

  1. JIMSMITH

    Indy Readbytes with timeout

    I use the indy tidtcpserver with the readbytes method. The code is ReadBytes(Buffer,buffsize, False). The buffsize is set for 1024. I receive varying amounts of data say 7000 bytes. After 6 passes I receive an timeout because ( after the first 6 *1024 = 6144 the last pass only has 7000 - 6144 = 856) only 856 bytes remain and the timeout occurs waiting to fill the buffer. When the timeout happens the bytes appear to remain in the iohandler buffer. The question is what is the best way to get the 6 chunks and the remaining 856 bytes without generating an exception? I prefer to use readbytes because ther could be different types of data other than strings. I hope this make sense and I appreciate assistance in advance.
  2. JIMSMITH

    Indy Readbytes with timeout

    Damn! You are awesome.
  3. JIMSMITH

    Sending and Receiving Data with Indy

    Please delete this message. Problem solved
  4. I want to create a server application that can handle multiple connections, even from the same computer. An important point is that if the client application disconnects from the server I need to be able to reconnect the application to the object in the server for continuity. I can handle the reconnect, I think, but need some assistance in associating the the context with the context or object from the original connection. When does the context get destroyed. Many question and I need help finding answers. Seems like I would have to keep a token or something to send to the server to recognize the repetitious connection for each application connected to the server. Am I correct in this assumption? I wonder how I know the connection that was disconnected if the network connection drops. Should I launch an anonymous thread to read and process the message from the execute event on the server? I am continuing m investigation.
  5. JIMSMITH

    Creating a Server Application using tidtcpserver

    Okay. I do create them and can get a connection from a pool. I assume that a criticalsection is not required if doing this.
  6. JIMSMITH

    Creating a Server Application using tidtcpserver

    When accessing executing dbqueries using tFDQuert components in a tidtcpserver event should a tcriticalsection?
  7. JIMSMITH

    Creating a Server Application using tidtcpserver

    Remy are there any good articles on the TIdContext and the TIdServerContext and how to use them and when to use one over the other properly? Thanks in advance.
  8. JIMSMITH

    Creating a Server Application using tidtcpserver

    I am starting to work on this. I always have a high level of confidence in your responses on any topic. Thank you very much.
  9. I have an application that connects a middle tier application that I created all using VCL windows. The middle tier application is accessed VIA tcp using Indy. The client application from many computers can access the middle tier at the same time. The problem I have is how do I harden the middle tier so that if an exception happens the entire middle tier is not hung. I do want the exception message to go back to the respective client, but I need the middle tier to be able to continue processing requests from other users.
  10. You are correct. This is what I am about to correct. I am getting some good clues from these responses. A response could be sent to the client in xml with Success or fail. Success would have the data and fail would have the extended error details. In the case of the ssl failure trapping the message and logging it to a file on the server and then sending the XML with failure would normally work, but this was a failure on connection so there might not be a client to respond to. Just log it on the server when capturing via the exception handler and just move on so the next client communication happens. This might be what I am looking for.
  11. This is a simple case where the 2 .dll files were not with the executable. The problem was not with the indy components either. The key information that I am looking for is how to manage the middle tier so that when any type of exception happens that the middle tier sends the exception to the client and continues to process other connections. Yes I can do this in the application using try finally and try except blocks. Just not sure how to implement this in a middle tier where I want the exception to be passed back to the client.
  12. I use indy tidtcpserver and client. The other day I had a computer that did not have ssl .dll files which resulted in exception in the middle tier. All processing was disrupted. I just need to send exception back to that client connection and allow the other connections continue to process.
  13. I tried to use Remobjects many years ago. Wasn't much documenrtation or many examples. Any questions took several days to get answers. Anyway I wonder how they handle exceptions so that other users continue to process without disruption..
  14. Given the JSON object below. I want to update the value of a JSON Pair. Here are a few questions - 1) Is there a fast way to find the JSON details for fiddler@office365.com. Do I have to loop through the each of the 4 entries. and check the value. 2) I want to update the new_token value from "rice" to "beans". 3) How do I add a new pair after "current_token". - This is last because I can probably figure #3 it out for myself. Help is much appreciaded in advance. { "SPWORKDATA": { "DB_PARAMS": { "DriverID":"Oracle", "Port":"9060", "Monitorby":"", "MetaDefSchema":"False" }, "MAILCONFIGS": [ {"sole.heel@apple.com": { "clickid": "307663883943-8", "social": "weeklyreader", "account": "rick.flair@gmail.com", "new_token":"", "current_token":"1//0f1U7S6-TZ-_r6RtWc" } }, {"timmona@office365.com": { "clickid": "client_data2", "secret": "appsecret", "social": "timmon.ray@office365.com", "new_token":"scacral", "current_token":"refreshtoken" } }, {"bruce@office365.com": { "clickid": "client_data2", "secret": "appsecret", "social": "bruce.richards@office365.com", "new_token":"soapl", "current_token":"refreen" } }, {"fiddler@office365.com": { "clickid": "client_d89", "secret": "appsoul", "social": "karen.richards@office365.com", "new_token":"rice", "current_token":"old" } } ], "MEDIASERVER": { "Server": "192.162.2.185" }, "MSGSERVER": { "Server": "127.0.0.1", "Port":"55555" } }
  15. Thanks for the information. An interesting read.
  16. Apologies. There are supposed to be commas. I have added. Thanks. I made manual changes to for illustration purposes and make my 1st mistake.
  17. I am using Delphi 10.1 update2. When processing a json file I cannot find the containskey method with a TJSONObject? Is there a work around to the the equivalent check JSONObject.containskey('keyvalue') for this version of Delphi?
  18. I am tring to read a section of json containing an array below for the section titled MAILCONFIGS. There is an array that contains two pairs. I need to read the two JSON PAIRS and breakout the datapair within. Any help will be appreciated, and Thanks in advance. { "SPWORKDATA": { "DB_PARAMS": { "Pooled":"False", "DriverID":"Oracle", "Database":"iranums", "User_name":"rms", "Password":"trojan", "Server":"lilly.com", "Port":"5432", "Monitorby":"", "MetaDefSchema":"False" }, "MAILCONFIGS": [ {"mail1@gmail.com": { "client_id": "ClientID_Data1", "apptoken": "apptoken data1", "temptoken": "temporary token1" } }, {"mail2@gmail.com": { "client_id": "client_data2", "apptoken": "apptoken data2", "temptoken": "temporary token2" } } ], "MEDIASERVER": { "Server": "192.162.2.185" }, "MSGSERVER": { "Server": "127.0.0.1", "Port":"55555" } } }
  19. JIMSMITH

    Reading a section of JSON

    Remy, I am using Delphi 10.1 Update 2. I was able to figure it out from the code that you provided plus prior work. So I am good at this point and thanks for your help.
  20. JIMSMITH

    Reading a section of JSON

    I am using Delphi 10.1 Update 2.
  21. I want to print to an Evolis Pebble printer using Delphi Berlin. Has anyone done this before? Is this possible since I see C++, C#, Swift, Python, and Swift examples? I have not seen any examples writing to this printer using Delphi. TIA
  22. Has anybody here used the tzdb project to retrieve the gmt offset as in gmt -6 etc. as in gmt -X for America/Havana or any other example that you can think of? FYI tzdb is located at Code Examples · pavkam/tzdb Wiki · GitHub
  23. For some reason I have to authorize my application through google to send email again. During the process I check the box indicates read, compuse, send email. I encounter an error indicated in the image below. The firewall has been turned off on this computer. Does anyone know how to resolve this error?
  24. JIMSMITH

    Sending Email VIA Google.

    Here is the latest information. The referenced mail project does include a TidHTTPServer. The port was changed and it no longer worked. I have corrected this problem and it works. Truth is I did not know that Oauth 2.0 communication required all of these pieces. I wish there was a flow diagram. Thanks for all of your help education.
  25. JIMSMITH

    Sending Email VIA Google.

    Remy , The product has a datamodule with a idhttpserver on it. I might have broken this part of the implementation. This is new ground for me with additional complications beyond my daily scope and skill set. I am digging into it to figure this oauth 2.0 process out. All assistance/input has been greatly appreciated. I need one of you sharp gents on retainer.
×