indy

Should TIdCmdTCPServer and TIdCmdTCPClient be used together?

旧巷老猫 提交于 2019-12-10 19:30:20
问题 I am trying to write a server and a set of clients that talk to the server. The server will maintain the status of different clients and allow them to alert the central server when there is a status change. A specialist client will allow the control of the other connected clients. I have the server as a TIdCmdTCPServer and the clients (at the moment) connect using TIdTCPClient. If the clients are sending and recieving commands, should they use TIdCmdTCPClient? I have read that the

Delphi Indy Send POST data in Cyrillic

风流意气都作罢 提交于 2019-12-10 18:55:28
问题 I want to send Cyrillic post data with delphi using indy 10. Ok i know how to send data but when i send something written or Cyrillic the post data response is with some encoded signs. there is my code http := TIDHttp.Create(nil); http.HandleRedirects := true; http.ReadTimeout := 5000; http.Request.ContentType:='multipart/form-data'; param:=TIdMultiPartFormDataStream.Create; param.AddFormField('com','offers'); param.AddFormField('op','new'); param.AddFormField('MAX_FILE_SIZE','1048576');

Sending and receiving a TMemoryStream using IdTCPClient and IdTCPServer

爱⌒轻易说出口 提交于 2019-12-10 16:34:23
问题 I found Remy Lebeau's chat demo of IdTCP components in XE2 and I wanted to play with it a little bit. (It can be found here) I would like to send a picture using these components and the best approach seems to be using TMemoryStream. If I send strings, the connection works fine, the strings are transmitted successfully, however when I change it to Stream instead, it doesn't work. Here is the code: Server procedure TMainForm.IdTCPServerExecute(AContext: TIdContext); var rcvdMsg: string; ms

Indy and REST - Can I prevent exceptions?

♀尐吖头ヾ 提交于 2019-12-10 15:43:11
问题 Is there a way to prevent Indy from raising exceptions on any/all HTTP statuses? My understanding of the IgnoreReplies array is that it'll prevent those statuses from ever coming back, but that's not what I want. I want ALL statuses coming back, and none of them to raise an exception. There are plenty of REST services that return 404 for example, and that's considered a perfectly "valid" response. I really don't want 1/2 of my code in exception handlers, so is there way to get the current

Install the latest build of Indy 10 on Delphi 2009 [duplicate]

杀马特。学长 韩版系。学妹 提交于 2019-12-10 14:46:21
问题 This question already has an answer here : Step by step upgrade of Indy 10 in Delphi 2009 (1 answer) Closed 5 months ago . Is there a step-by-step guide for updating the Indy 10 components in Delphi 2009? I've read the uninstalling thread and have the latest build (IndyTiburon.zip). However there appears to be no installation instructions. If you have accomplished this, please share the details. Edit: I have managed to get the packages installed by messing with the "requires" section in

Indy HTTP: reading response content on a 403

一曲冷凌霜 提交于 2019-12-10 14:12:25
问题 I am having a problem using Indy HTTP (in Delphi) with the Google Contacts API. Please refer to the section "ClientLogin Response" on the following page: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html The server returns a 403 when the authentication is incorrect or an error occurs... as expected. However, according to this document, there is information in the response content that is needed by the client, e.g. the error reason, and captcha URL, etc. The problem is that

Store a screen capture (Bitblt) in a memory buffer to send over IdTCPClient

让人想犯罪 __ 提交于 2019-12-10 12:17:59
问题 In c++ builder 6 on windows vista ... Graphics:: TBitmap * bmpscreencapture = new Graphics::TBitmap; bmpscreencapture-> Height = Screen-> Height; bmpscreencapture-> Width = Screen-> Width; HDC ScreenSrc = GetWindowDC (0); BitBlt (bmpscreencapture-> Canvas-> Handle, 0, 0, Screen-> Width, Screen-> Height, ScreenSrc, 0, 0, SRCCOPY); Canvas->Draw(10, 10, bmpscreencapture); ReleaseDC (GetDesktopWindow (), ScreenSrc); delete bmpscreencapture; I currently have a section of code for capturing the

Udp image streaming, delphi indy10

末鹿安然 提交于 2019-12-10 12:07:58
问题 i'm using delphi xe4 with indy10 component and i want to send an image from an Tidudpclient to Tidudpserver. I already done this operation with tcp component,but the same code didn't work with udp. how i can do this? Thanks in advance! Timage(client)--->streamUDP-->Timage(server) CLIENT SIDE----------------------------------------------- SEND IMAGE var pic: tbitmap; Strm : TMemoryStream; img2:Timage; buffer:TIdBytes; begin try img2:=Timage.Create(nil); pic:=Tbitmap.Create; Takekpic(pic);

Delphi: Setting connection timeout for TIdHttpServer

妖精的绣舞 提交于 2019-12-10 11:07:18
问题 Using TIdHTTPServer (Indy 10.6), i want set a connection timeout for close slow or inactive client (client are common browser) and close all zombie connection after 60 seconds of inactivity. I have found Socket.ReadTimeout in TIdContext.Connection. Is this the right way? TIdHTTPServer already perform this (it seem have infinite timeout)? WebServer := TIdHTTPServer.Create(nil); WebServer.SessionState := false; WebServer.KeepAlive := false; WebServer.OnCommandGet := CustomOnCommandGet;

Global, thread safe, cookies manager with Indy

我怕爱的太早我们不能终老 提交于 2019-12-10 10:53:36
问题 My Delphi 2010 app uploads stuff using multi-threading, uploaded data is POSTed to a PHP/web application which requires login, so I need to use a shared/global cookies manager (I'm using Indy10 Revision 4743 ) since TIdCookieManager is not thread-safe :( Also, server side, session id is automatically re-generated every 5 minutes, so I must keep both the global & local cookie managers in sync. My code looks like this: TUploadThread = class(TThread) // ... var GlobalCookieManager :