12/4/2020 0 Comments Tidtcpclient
Sounds pretty simple, right FWIW, Ive certainly not used sockets just before.
Tidtcpclient Code For ConnectingsendingreceivingThe vendor of the machine has provided me structure C.Internet code for connectingsendingreceiving.Thats excellent, and it functions excellent (Ive tested it, and it will specifically what its expected to do).Tidtcpclient Dll That WouldHowever, had been using Delphi 5 for this project, and Im attempting to avoid writing a.NET dll that would have to be known as from the Delphi app.Weve already had the Indy components for additional projects, so I chose Id give those a proceed for this. The problem Im getting is definitely that I can discover the XML request Im sending to the machine, but Im not getting a reaction back again from the server until Ive shut off completely (I can observe all of this using Wireshark). When I attempt to examine the reaction from the machine, I get nothing. The one thing I observe in the.NET socket code is certainly that there will be a technique that allows you to detach the delivering part of the outlet. ![]() Anyone have got any suggestions Heres my Delphi program code: Program code with IdTcpClient1 perform begin Connect; CheckServerResponse can be the XML line being sent WriteBuffer(CHECKSERVERRESPONSE, Size(CHECKSERVERRESPONSE), Genuine); Sleep(1000); ReadBuffer(Resp, Size(Resp)); Resp arrives back again as an vacant string Disconnect; At this point, I can see in Wireshark that the machine has delivered the reaction I was expecting. You need to attach your sendreceive code to the TIdTCPClient.OnConnect event such as CODE method TForm1.IdTCPClient1Connécted(Sender: TObject); vár Resp: Line; start with IdTCPClient1.IOHandler do start WriteLn(CHECKSERVERRESPONSE); Resp: ReadLn; end; IdTCPClient1.Detachment; end; This will obtain called when you call IdTCPClient1.Connect. If its hanging there its because the machine is not sending anything to your client. It may end up being the mistake of the server, or because your customer is not pursuing the communication protocol properly. If the machine is not really sending that, after that ReadLn will carry on to wait. I missed what you stated about WireShark - I suppose this will be port monitor If the machine is delivering the response, after that your barrier code must be incorrect. This is not great style, because if the machine breaks for a time, it will end up being interpreted as finished and the client will keep on. The machine must deliver some indicator of when its completed transmitting, either by sending a 0, or buggy return or by showing beforehand how many bytes its transmitting. I have it running listening for visitors on slot 2077 (which is usually the port I have to use to sendreceive from the machine). So I can find that the server is sending the response, but not until I disconnect the socket. Has the dealer been able to assist you I cant find how the C sample code would execute any in different ways than the Delphi code you possess. Reasons like as off-topic, duplicates, fire flames, unlawful, vulgar, or students posting their homework. The Tek-Tips personnel will check out this out and get appropriate actions. Unauthorized reproduction or connecting forbidden without indicated written permission. Registration on or use of this web site constitutes approval of our Personal privacy Plan.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |