Re: [twsocket] Converting memorystream to string?
Hello! procedure LoginSocketDocEnd(Sender: TObject); var p: PChar; s: string; begin p := TMemoryStream(LoginSocket.RcvdStream).Memory; s:= Copy(StrPas(p), 1, LoginSocket.RcvdStream.Size); This will crash if source TMemoryStream doesn't end with #0. Moreover, this copies data twice (wastes time and memory). Use this: SetLength(s, LoginSocket.RcvdStream.Size); Move(TMemoryStream(LoginSocket.RcvdStream).Memory^, pointer(s)^, LoginSocket.RcvdStream.Size); -- Piotr Dałek [EMAIL PROTECTED] -- Prosty kredyt na wszystkie potrzeby. Od 1000 zl do 120 000 zl. Bez poreczycieli i zabezpieczen http://link.interia.pl/f1edf -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Using TWSocket
Hi All I'm trying to write a simple TCP/IP app but I'm not sure how to actually send data. The Send Method of ICS v6 requires a data type TWSocketData, yet the documentation states it needs a pointer. On the ICS page there is mention of a sample app, Client5, that would probably solve my problem, but I'm unable to find it in the download package of ICS V6. This is for Delphi. Any help appreciated! Thanks, Hein -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Using TWSocket
you can use SendStr to send a simple text - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, August 14, 2008 4:59 PM Subject: [twsocket] Using TWSocket Hi All I'm trying to write a simple TCP/IP app but I'm not sure how to actually send data. The Send Method of ICS v6 requires a data type TWSocketData, yet the documentation states it needs a pointer. On the ICS page there is mention of a sample app, Client5, that would probably solve my problem, but I'm unable to find it in the download package of ICS V6. This is for Delphi. Any help appreciated! Thanks, Hein -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Using TWSocket
Thanks Brian Unfortunately the application on the server requires a binary length indicator first, followed by XML. The XML part is easy with the SendStr function. Thanks, Hein -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: 14 August 2008 17:29 To: ICS support mailing Subject: Re: [twsocket] Using TWSocket you can use SendStr to send a simple text - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, August 14, 2008 4:59 PM Subject: [twsocket] Using TWSocket Hi All I'm trying to write a simple TCP/IP app but I'm not sure how to actually send data. The Send Method of ICS v6 requires a data type TWSocketData, yet the documentation states it needs a pointer. On the ICS page there is mention of a sample app, Client5, that would probably solve my problem, but I'm unable to find it in the download package of ICS V6. This is for Delphi. Any help appreciated! Thanks, Hein -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Using TWSocket
Then you can either use .send with a memory pointer or load the entire xml into a string - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: 'ICS support mailing' twsocket@elists.org Sent: Thursday, August 14, 2008 5:44 PM Subject: Re: [twsocket] Using TWSocket Thanks Brian Unfortunately the application on the server requires a binary length indicator first, followed by XML. The XML part is easy with the SendStr function. Thanks, Hein -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: 14 August 2008 17:29 To: ICS support mailing Subject: Re: [twsocket] Using TWSocket you can use SendStr to send a simple text - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, August 14, 2008 4:59 PM Subject: [twsocket] Using TWSocket Hi All I'm trying to write a simple TCP/IP app but I'm not sure how to actually send data. The Send Method of ICS v6 requires a data type TWSocketData, yet the documentation states it needs a pointer. On the ICS page there is mention of a sample app, Client5, that would probably solve my problem, but I'm unable to find it in the download package of ICS V6. This is for Delphi. Any help appreciated! Thanks, Hein -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Using TWSocket
I'm doing this: Var p: Pointer; Size: Word; WSocket.BufSize:= 2; p:= @Size; WSocket.Send(p); I'm getting There's no overloaded version of 'Send' that can be called with these arguments. If I can just get those two bytes out, I can send the XML message as a string in sendstr as you've said. Thanks ahead Hein -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: 14 August 2008 18:08 To: ICS support mailing Subject: Re: [twsocket] Using TWSocket Then you can either use .send with a memory pointer or load the entire xml into a string - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: 'ICS support mailing' twsocket@elists.org Sent: Thursday, August 14, 2008 5:44 PM Subject: Re: [twsocket] Using TWSocket Thanks Brian Unfortunately the application on the server requires a binary length indicator first, followed by XML. The XML part is easy with the SendStr function. Thanks, Hein -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: 14 August 2008 17:29 To: ICS support mailing Subject: Re: [twsocket] Using TWSocket you can use SendStr to send a simple text - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, August 14, 2008 4:59 PM Subject: [twsocket] Using TWSocket Hi All I'm trying to write a simple TCP/IP app but I'm not sure how to actually send data. The Send Method of ICS v6 requires a data type TWSocketData, yet the documentation states it needs a pointer. On the ICS page there is mention of a sample app, Client5, that would probably solve my problem, but I'm unable to find it in the download package of ICS V6. This is for Delphi. Any help appreciated! Thanks, Hein -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Using TWSocket
Just another note, the declaration of Send is: functionSend(const Data : TWSocketData; Len : Integer) : Integer; overload; virtual; What is TWSocketData ?? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: 14 August 2008 18:08 To: ICS support mailing Subject: Re: [twsocket] Using TWSocket Then you can either use .send with a memory pointer or load the entire xml into a string - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: 'ICS support mailing' twsocket@elists.org Sent: Thursday, August 14, 2008 5:44 PM Subject: Re: [twsocket] Using TWSocket Thanks Brian Unfortunately the application on the server requires a binary length indicator first, followed by XML. The XML part is easy with the SendStr function. Thanks, Hein -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: 14 August 2008 17:29 To: ICS support mailing Subject: Re: [twsocket] Using TWSocket you can use SendStr to send a simple text - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, August 14, 2008 4:59 PM Subject: [twsocket] Using TWSocket Hi All I'm trying to write a simple TCP/IP app but I'm not sure how to actually send data. The Send Method of ICS v6 requires a data type TWSocketData, yet the documentation states it needs a pointer. On the ICS page there is mention of a sample app, Client5, that would probably solve my problem, but I'm unable to find it in the download package of ICS V6. This is for Delphi. Any help appreciated! Thanks, Hein -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Using TWSocket
functionSend(const Data : TWSocketData; Len : Integer) : Integer; overload; virtual; What is TWSocketData ?? In Delphi, your CTRL+Click on the symbol to find the definition. Find in files also work nice. -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: 'ICS support mailing' twsocket@elists.org Sent: Thursday, August 14, 2008 6:38 PM Subject: Re: [twsocket] Using TWSocket Just another note, the declaration of Send is: functionSend(const Data : TWSocketData; Len : Integer) : Integer; overload; virtual; What is TWSocketData ?? Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: 14 August 2008 18:08 To: ICS support mailing Subject: Re: [twsocket] Using TWSocket Then you can either use .send with a memory pointer or load the entire xml into a string - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: 'ICS support mailing' twsocket@elists.org Sent: Thursday, August 14, 2008 5:44 PM Subject: Re: [twsocket] Using TWSocket Thanks Brian Unfortunately the application on the server requires a binary length indicator first, followed by XML. The XML part is easy with the SendStr function. Thanks, Hein -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of brian Sent: 14 August 2008 17:29 To: ICS support mailing Subject: Re: [twsocket] Using TWSocket you can use SendStr to send a simple text - Original Message - From: Hein du Plessis [EMAIL PROTECTED] To: twsocket@elists.org Sent: Thursday, August 14, 2008 4:59 PM Subject: [twsocket] Using TWSocket Hi All I'm trying to write a simple TCP/IP app but I'm not sure how to actually send data. The Send Method of ICS v6 requires a data type TWSocketData, yet the documentation states it needs a pointer. On the ICS page there is mention of a sample app, Client5, that would probably solve my problem, but I'm unable to find it in the download package of ICS V6. This is for Delphi. Any help appreciated! Thanks, Hein -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be