Re: [twsocket] udp packet loss
Hi, I'll assume you use a direct cable or put wireshark at the receiving computer because sending a packet is not a problem. Having the packet reaching the network card of the receiving computer is a different thing if there is something in between. Yes, I use a cross cable and two laptop with 1gbps ethernet cards (CPU1=T8100@2.10GHz CPU2=T2300@1.66GHz). I use wireshark on the udp server machine in this way: 1. Start wireshark on port 9000 (udp server is listening on it). 2. Start udp server (expected packet number is set to 1) 3. Start udp client on the client machine (start sending packets, first packet number=1) 4. When udp server signal packet loss stop the client. 5. If packet loss is not signalled try to resize the udp server form, or reduce time interval on the client (min=0 max speed). 5. Search inside wireshark the expected lost packet: I can see the packet (the first 4 bytes correspond to the wireshark packet number). If I set Interval=0 (max speed) on the client, the bitrate exceeds 100Mbps, but some packets are lost. It is not the messages which interfere, but GUI message processing can be very slow compared to network messages and while a GUI message is processed, no other message of the same thread can be processed. So I've created a worker thread that manage socket in its own message loop. That's perfect. But be sure to avoid using Synchronize or to block your thread while the GUI handle your messages. You really have the thread pumping messages as fast as possible. Just read the UDP socket and put the message in a queue for the GUI thread, then signal the GUI that the queue has a new message and let the thread pump the next message. Look at how your worker thread handle messages. As I said above, it has to be as fast as possible. Just receive the data into some kind of queue and signal it to the GUI thread without ever waiting for the GUI thread to handle the data. Probably not. At least you have to pass data to the GUI thread. This is the windows procedure of the udp server thread: procedure TUDPServer.ThreadWndProc(var aMessage:TMessage); begin if aMessage.Msg=WM_UDP_LISTEN then begin fExpected:=1; fWS.Listen; end; if aMessage.Msg=WM_UDP_CLOSE then begin fWS.Close; end; inherited ThreadWndProc(aMessage); end; and this is the DataAvailable of the socket: procedure TUDPServer.WSocketDataAvailable(Sender: TObject; Error: Word); var lBuffer:array[0..1500] of AnsiChar; lLen:integer; lSrc:TSockAddrIn; lSrcLen:integer; lRx:integer; begin lSrcLen:=SizeOf(lSrc); lLen:=fWS.ReceiveFrom(@lBuffer,SizeOf(lBuffer),lSrc,lSrcLen); if lLen=0 then begin inc(pBR,lLen); move(lBuffer[0],lRx,4); if lRx fExpected then PostMessage(self.fHandle,WM_UDP_DATA,lRx,fExpected); fExpected:=lRx+1; if lLenfExpectedSize then PostMessage(self.fHandle,WM_UDP_SIZE,lLen,fExpectedSize); end; end; If the thread detects a packet loss or a packet size error (size error never happened) it sends a message to the GUI thread (self.fHandle). No other operation is done. One last note: Disable any firewall and security product to do your testing. Many of those security products are trapping network traffic and can slow down thruput and may have bugs. So in case of difficulties like you have, it is better to disable everything and use a bare bone clean computer setup. Of course later you'll turn security back on. Yes I have no firewall. Another thing: I have tried using udp client/server on the same computer, and in this case the packet loss is reached only trasmitting at the max speed possible, but: 1. Wireshark doesn't capture packets on the same machine. 2. The cpu goes very high. So I think that packet loss is possible in this situation. I prefere to use two separated laptops. My client/server project size is only 12KB, is it possible to attach it to the mail? Someone could try it... If you think that could be a good example in order to test network udp performance (and it is not buggy), it could be added to the user made section of the ics site. Thank you, Emanuele -- 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] TTwitter component
Updated the library and uploaded to my site to reflect this modification. Sadly though, OverbyteIcsHttpCCodZLib is still problematic, I have to keep using the modified version to make it work. On Sun, Feb 27, 2011 at 7:56 AM, Francois PIETTE francois.pie...@skynet.bewrote: I will modify the code to use a variable for this outside the ics unit, as this will create only extra complication when a new ICS is available. Good :-) But, you mention it's very different from your current one, do you mean a new version still in development? since I have the latest distribution available from your website, unless I've missed a link to a beta or newer version :) The latest version is always available from the subversion repository (svn://svn.overbyte.be/ics/trunk or daily snapshot). The zip file at www.overbyte.be is updated only once or twice a year at some fixed milestones. See http://wiki.overbyte.be/wiki/index.php/ICS_Download -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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] FTP client testing
ARMSL ics.ftptest.org Personally, I cannot make it work even with Filezilla: SSL is now working with the public FTP server, the ICS FTP server was already configured to use a limited range of passive ports, so I just added these to the firewall (at the same time as blocking as various Far East ISPs that are hacking me) and FileZilla and ICS FTP client are now both working, with passive mode only. If you email me privately, I'll set-up a test FTP login account so you can upload stuff. Angus -- 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] TTwitter component
Updated the library and uploaded to my site to reflect this modification. Super ! Sadly though, OverbyteIcsHttpCCodZLib is still problematic, I have to keep using the modified version to make it work. I can't find your unit. Is it the chnage that Henri Gourvest published (see attached message) and which never reached the source code ? -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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] udp packet loss
My client/server project size is only 12KB, is it possible to attach it to the mail? Someone could try it... It don't primize, but you may send the source code to me (no executable please) I will try to test it. Include complete projects so that I can test within a few minutes, and instructions to reproduce the issue. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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] TTwitter component
Don't see an attached message in your reply :( but anyway, lurking through the archives some time ago I found someone submitted a modification to apparently fix this problem, but that still didnt work for me. Changing this in OverbyteIcsHttpCCodZLib did the trick though: 55: Result := 'gzip, deflate'; Simply added deflate to the result. Without that, I don't get any data back. On Sun, Feb 27, 2011 at 3:05 PM, Francois PIETTE francois.pie...@skynet.bewrote: Updated the library and uploaded to my site to reflect this modification. Super ! Sadly though, OverbyteIcsHttpCCodZLib is still problematic, I have to keep using the modified version to make it work. I can't find your unit. Is it the chnage that Henri Gourvest published (see attached message) and which never reached the source code ? -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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] TTwitter component
On 27-02-2011 16:01, brian - wrote: Simply added deflate to the result. Without that, I don't get any data back. Juts tested your component here, without that modification, and works just fine. What exactly happen in your case. What data you don't get? -- 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] TTwitter component
posted an update to my lib: http://eden.fm/2011/02/27/another-twitter-library-update-v0-3/ http://eden.fm/2011/02/27/another-twitter-library-update-v0-3/You can now use an alternate method to wont require the user to visit the twitter site to get the PIN code, the app will simulate a browser login, catch the cookies and proceed to auth on its own to retrieve the PIN. the issue about OverbyteIcsHttpCCodZLib is not related to this twitter library, just in general, if you try to retrieve a page with GZip there's no data returned. On Sun, Feb 27, 2011 at 5:54 PM, RTT p...@sapo.pt wrote: On 27-02-2011 16:01, brian - wrote: Simply added deflate to the result. Without that, I don't get any data back. Juts tested your component here, without that modification, and works just fine. What exactly happen in your case. What data you don't get? -- 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] HttpCli / Async in thread problems --- Tryng to trace
Arno Garrels wrote: Frans van Daalen wrote: One was using webmarshal and the other ISA. But i'm not behind a proxy and also still keep getting the HTTP component is busy error message when using the async get. It still doesn't work probably so don't send it to your customer yet. I'm working on this stuff again since a couple of hours with some progress, I'll commit another fix soon when it's ready, not before monday. Ok ! There is other work laying around so... ;-) Well, I just checked in a new change with log: Any progress with patch rev #669+ ? -- Arno Garrels -- 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] TTwitter component
posted an update to my lib: http://eden.fm/2011/02/27/another-twitter-library-update-v0-3/ Link to download on the page is broken ! -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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] TTwitter component
You can remove the b64ASM.pas dependency using the ICS equivalent //b64asm.Base64Encode(HMAC_SHA1_EX(SignBase,signkey)); OverbyteIcsMimeUtils.Base64Encode(HMAC_SHA1_EX(SignBase,signkey)); Probably not so fast, but not really important in this case of small length strings. -- 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] TTwitter component
Ahh thanks, should have looked there first :) replaced it now. Download link should work now. On Sun, Feb 27, 2011 at 6:45 PM, RTT p...@sapo.pt wrote: You can remove the b64ASM.pas dependency using the ICS equivalent //b64asm.Base64Encode(HMAC_SHA1_EX(SignBase,signkey)); OverbyteIcsMimeUtils.Base64Encode(HMAC_SHA1_EX(SignBase,signkey)); Probably not so fast, but not really important in this case of small length strings. -- 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] udp packet loss
Hi, now I've made a console application for the UDP server, but nothing changes. I see packet loss inside application, but all packets are correctly captured by wireshark. Thankyou, Emanuele Il 27/02/2011 15.09, Francois PIETTE ha scritto: My client/server project size is only 12KB, is it possible to attach it to the mail? Someone could try it... It don't primize, but you may send the source code to me (no executable please) I will try to test it. Include complete projects so that I can test within a few minutes, and instructions to reproduce the issue. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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 -- Ing. Emanuele Bizzarri Software Development Department e-works s.r.l. 41011 - Campogalliano - Modena - Italy tel. +39 059 2929081 int. 23 fax +39 059 2925035 e-mail: e.bizza...@e-works.it - http://www.e-works.it - La presente comunicazione, che potrebbe contenere informazioni riservate e/o protette da segreto professionale, è indirizzata esclusivamente ai destinatari della medesima qui indicati. Le opinioni, le conclusioni e le altre informazioni qui contenute, che non siano relative alla nostra attività caratteristica, devono essere considerate come non inviate né avvalorate da noi. Tutti i pareri e le informazioni qui contenuti sono soggetti ai termini ed alle condizioni previsti dagli accordi che regolano il nostro rapporto con il cliente. Nel caso in cui abbiate ricevuto per errore la presente comunicazione, vogliate cortesemente darcene immediata notizia, rispondendo a questo stesso indirizzo di e-mail, e poi procedere alla cancellazione di questo messaggio dal Vostro sistema. E' strettamente proibito e potrebbe essere fonte di violazione di legge qualsiasi uso, comunicazione, copia o diffusione dei contenuti di questa comunicazione da parte di chi la abbia ricevuta per errore o in violazione degli scopi della presente. - This communication, that may contain confidential and/or legally privileged information, is intended solely for the use of the intended addressees. Opinions, conclusions and other information contained in this message, that do not relate to the official business of this firm, shall be considered as not given or endorsed by it. Every opinion or advice contained in this communication is subject to the terms and conditions provided by the agreement governing the engagement with such a client. If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. Any use, disclosure, copying or distribution of the contents of this communication by a not-intended recipient or in violation of the purposes of this communication is strictly prohibited and may be unlawful. -- 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] TTwitter component
On 27-02-2011 17:18, brian - wrote: use an alternate method to wont require the user to visit the twitter site to get the PIN code, the app will simulate a browser login, catch the cookies and proceed to auth on its own to retrieve the PIN. This will work until twitter decide to change these html pages. But with Twitter you can even bypass the need of a PIN. Just remove all the oauth_verifier references and you will see that works without PIN. -- 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] TTwitter component
that alternate method was mostly a test to see if I could make it work, I still encourage using the PIN system :) I like it tbh, even with the annoyance of havign to login and retrieve the pass for the user, it's only required once. ill most likely remove this alternate proc in next revision, and add XAuth support instead. On Sun, Feb 27, 2011 at 7:25 PM, RTT p...@sapo.pt wrote: On 27-02-2011 17:18, brian - wrote: use an alternate method to wont require the user to visit the twitter site to get the PIN code, the app will simulate a browser login, catch the cookies and proceed to auth on its own to retrieve the PIN. This will work until twitter decide to change these html pages. But with Twitter you can even bypass the need of a PIN. Just remove all the oauth_verifier references and you will see that works without PIN. -- 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] TTwitter component
On 27-02-2011 18:39, brian - wrote: I like it tbh, even with the annoyance of havign to login and retrieve the pass for the user, it's only required once. As I said, Twitter don't require the PIN, so you can ignore that step. User only need to authorize the application, and forget about the PIN. Instead of using the ShellExecute to open the browser, you can use the TTwitter approach. Start a modal Request Authorization form with a TWebBrowser pointed to that address. This way you can proceed with the RequestAccess after user close that authorization form. Using this idea, another thing you could do to make your component more user friendly, is to execute internally all the authentication steps, the first time they are needed. User will just need to create the component and call the SendTwit method. The callback will be used only to get the success/unsuccess of the send. ill most likely remove this alternate proc in next revision, and add XAuth support instead. With both methods you should use SSL, or you will be passing user and password in plain text. -- 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] TTwitter component
hmm interesting, I will test about the PIN; I guess Twitter associates the 1st auth token with the user's account after they allow the app. I don't really like the idea of embedding the TWebBrowser object, bulky and buggy activex stuff. On Sun, Feb 27, 2011 at 8:18 PM, RTT p...@sapo.pt wrote: On 27-02-2011 18:39, brian - wrote: I like it tbh, even with the annoyance of havign to login and retrieve the pass for the user, it's only required once. As I said, Twitter don't require the PIN, so you can ignore that step. User only need to authorize the application, and forget about the PIN. Instead of using the ShellExecute to open the browser, you can use the TTwitter approach. Start a modal Request Authorization form with a TWebBrowser pointed to that address. This way you can proceed with the RequestAccess after user close that authorization form. Using this idea, another thing you could do to make your component more user friendly, is to execute internally all the authentication steps, the first time they are needed. User will just need to create the component and call the SendTwit method. The callback will be used only to get the success/unsuccess of the send. ill most likely remove this alternate proc in next revision, and add XAuth support instead. With both methods you should use SSL, or you will be passing user and password in plain text. -- 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] udp packet loss
Hi, I have received your code and looking at it. I cannot reproduce the packet loss on localhost. I can reproduce on different computers, but I found a flaw in your design: remember TWSocket use non blocking. SendTo will fail if winsock is not able to receive data and you don't check that condition. Here is how I found the problem: procedure TForm1.OnTimer(aSender:TObject); begin if fWS.State=wsConnected then begin move(fCounter,fData^,4); if fWS.SendTo(fPeerSrc,fPeerSrcLen,fData,fDataSize) = fDataSize then test changed begin inc(fCounter); inc(fBR,fDataSize); end else ShowMessage('send failed'); message displayed Restart; end; end; You can't call SendTo as fast as you like when the socket is using async mode. Before sending, you should check if the event OnDataSent has been triggered. I'm not sure you correctly checked with wireshark that all packets where sent actually because their aren't when SendTo fails. -- francois.pie...@overbyte.be 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: emanuele bizzarri e.bizza...@e-works.it To: twsocket@elists.org Sent: Sunday, February 27, 2011 7:05 PM Subject: Re: [twsocket] udp packet loss Hi, now I've made a console application for the UDP server, but nothing changes. I see packet loss inside application, but all packets are correctly captured by wireshark. Thankyou, Emanuele Il 27/02/2011 15.09, Francois PIETTE ha scritto: My client/server project size is only 12KB, is it possible to attach it to the mail? Someone could try it... It don't primize, but you may send the source code to me (no executable please) I will try to test it. Include complete projects so that I can test within a few minutes, and instructions to reproduce the issue. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) 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] TTwitter component
On 27-02-2011 19:29, brian - wrote: I don't really like the idea of embedding the TWebBrowser object, bulky and buggy activex stuff. The WebBrowser control works very well for this simple navigate to a page task. If you want to test, just replace your RequestPIN code with the next one. uses forms, ShDocVw, Controls; ... procedure TwitterCli.RequestPIN; var AuthForm: TForm; WebBrowser: TWebBrowser; begin AuthForm := TForm.create(application.MainForm); with AuthForm do begin BorderStyle := bsDialog; Caption := 'Twitter Authorization - Authorize and close this dialog'; width := screen.width - screen.width div 5; height := screen.height - screen.height div 5; Position := poScreenCenter; end; WebBrowser := TWebBrowser.Create(authForm); TWinControl(WebBrowser).Parent := authForm; WebBrowser.Align := alClient; WebBrowser.Navigate(RequestPinURL); authForm.ShowModal; authForm.free; end; Also, if you in the end decide to maintain the ShellExecute, then better specify the 'Open' verb. Some system may have the default verb defined differently. ShellExecute(0, 'open', PChar('https://twitter.com/oauth/authorize?oauth_token=' + OAuthToken), '', '', SW_SHOWNORMAL); And you don't need to declare the ShellExecute import, just use the one defined in the ShellAPI unit. --- Why you decided to use the GPL v3? IMHO, for small , and simple, code projects like this one, better use a license that can be used in closed code applications, or commercial users will just grab/mangle the code and don't give you any credit. If credit is given, they will need to open the code too, and that isn't going to happen. On the other hand, if license permits closed code, they have no problem to include the reference. -- 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] TTwitter component
I was actually 'open' for years, but I've been seeing users not able to launch urls from my apps with that, cause the default browser may not have defined that command, was still using it in the first versions of twitter lib. I added the ShellExecute import to avoid adding another unit; I rather not include entire units for things where I need only a couple procs and such, it adds up to the exe unnecesarily. As for webbrowser, hmm, I think I still prefer either the PIN or self-auth approach, else, how we know the user actually allowed the app, we can't just blindly assume they'll do and think we are now authorized, so the last PIN step takes care of that. I read somewhere about embedding a chromium window in delphi btw, heard anything? I'm curious to test, gonna check for it. I really still dont like the twebbrowser at all. But maybe I could have a compiler conditional so the user can opt for a way or another. Doesn't GPL allow your code to be included in closed source applications as well? as long as the code hasnt been modified; unless I understood it all wrong. Tbh it's the first time in over ~12 years programming Im opening up to release and share source code, so I never looked much into open source licenses until just now. Would appreciate some insight about it :) On Mon, Feb 28, 2011 at 12:08 AM, RTT p...@sapo.pt wrote: On 27-02-2011 19:29, brian - wrote: I don't really like the idea of embedding the TWebBrowser object, bulky and buggy activex stuff. The WebBrowser control works very well for this simple navigate to a page task. If you want to test, just replace your RequestPIN code with the next one. uses forms, ShDocVw, Controls; ... procedure TwitterCli.RequestPIN; var AuthForm: TForm; WebBrowser: TWebBrowser; begin AuthForm := TForm.create(application.MainForm); with AuthForm do begin BorderStyle := bsDialog; Caption := 'Twitter Authorization - Authorize and close this dialog'; width := screen.width - screen.width div 5; height := screen.height - screen.height div 5; Position := poScreenCenter; end; WebBrowser := TWebBrowser.Create(authForm); TWinControl(WebBrowser).Parent := authForm; WebBrowser.Align := alClient; WebBrowser.Navigate(RequestPinURL); authForm.ShowModal; authForm.free; end; Also, if you in the end decide to maintain the ShellExecute, then better specify the 'Open' verb. Some system may have the default verb defined differently. ShellExecute(0, 'open', PChar(' https://twitter.com/oauth/authorize?oauth_token=' + OAuthToken), '', '', SW_SHOWNORMAL); And you don't need to declare the ShellExecute import, just use the one defined in the ShellAPI unit. --- Why you decided to use the GPL v3? IMHO, for small , and simple, code projects like this one, better use a license that can be used in closed code applications, or commercial users will just grab/mangle the code and don't give you any credit. If credit is given, they will need to open the code too, and that isn't going to happen. On the other hand, if license permits closed code, they have no problem to include the reference. -- 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] TTwitter component
On 27-02-2011 23:31, brian - wrote: I added the ShellExecute import to avoid adding another unit; I rather not include entire units for things where I need only a couple procs and such, it adds up to the exe unnecesarily. The smart linking feature should work ok for the shellapi unit. As for webbrowser, hmm, I think I still prefer either the PIN or self-auth approach, else, how we know the user actually allowed the app, we can't just blindly assume they'll do and think we are now authorized, so the last PIN step takes care of that. That's a user problem. But you can add a InputQuery('Enter your PIN','PIN', Twit.AccessPIN); just after the modal form closes. Add also initialization OleInitialize(nil); finalization OleUninitialize; So user can copy the pin text from the webbrowser to the clipboard. I read somewhere about embedding a chromium window in delphi btw, heard anything? I'm curious to test, gonna check for it. I really still dont like the twebbrowser at all. But maybe I could have a compiler conditional so the user can opt for a way or another. http://www.progdigy.com/ Doesn't GPL allow your code to be included in closed source applications as well? as long as the code hasnt been modified; unless I understood it all wrong. Tbh it's the first time in over ~12 years programming Im opening up to release and share source code, so I never looked much into open source licenses until just now. Would appreciate some insight about it :) V3 seems to change some things, but there is no general consensus about this, (money always turn lawyers language in favor with who pays more), so better stay away of it if you want to maintain closed source. -- 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] TTwitter component
I think you might want to use the BSD license -or- the Freeware License ICS uses. It is my understanding the GPL v3 license restricts any commercial closed source use except in the case that the GPL'ed source code is compiled into a separate library that is linked to during run-time vs. being compiled into the exe file itself. It is my understanding the BSD license allows anyone to do anything with the source however you retain full copyright and ownership. For example the Mac OS X is based off of FreeBSD http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/ KernelProgramming/BSD/BSD.html DISCALAIMER - I am not a lawyer and you should consult legal advice concerning such matters. -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of brian - Sent: Sunday, February 27, 2011 6:32 PM To: ICS support mailing Subject: Re: [twsocket] TTwitter component I was actually 'open' for years, but I've been seeing users not able to launch urls from my apps with that, cause the default browser may not have defined that command, was still using it in the first versions of twitter lib. I added the ShellExecute import to avoid adding another unit; I rather not include entire units for things where I need only a couple procs and such, it adds up to the exe unnecesarily. As for webbrowser, hmm, I think I still prefer either the PIN or self-auth approach, else, how we know the user actually allowed the app, we can't just blindly assume they'll do and think we are now authorized, so the last PIN step takes care of that. I read somewhere about embedding a chromium window in delphi btw, heard anything? I'm curious to test, gonna check for it. I really still dont like the twebbrowser at all. But maybe I could have a compiler conditional so the user can opt for a way or another. Doesn't GPL allow your code to be included in closed source applications as well? as long as the code hasnt been modified; unless I understood it all wrong. Tbh it's the first time in over ~12 years programming Im opening up to release and share source code, so I never looked much into open source licenses until just now. Would appreciate some insight about it :) On Mon, Feb 28, 2011 at 12:08 AM, RTT p...@sapo.pt wrote: On 27-02-2011 19:29, brian - wrote: I don't really like the idea of embedding the TWebBrowser object, bulky and buggy activex stuff. The WebBrowser control works very well for this simple navigate to a page task. If you want to test, just replace your RequestPIN code with the next one. uses forms, ShDocVw, Controls; ... procedure TwitterCli.RequestPIN; var AuthForm: TForm; WebBrowser: TWebBrowser; begin AuthForm := TForm.create(application.MainForm); with AuthForm do begin BorderStyle := bsDialog; Caption := 'Twitter Authorization - Authorize and close this dialog'; width := screen.width - screen.width div 5; height := screen.height - screen.height div 5; Position := poScreenCenter; end; WebBrowser := TWebBrowser.Create(authForm); TWinControl(WebBrowser).Parent := authForm; WebBrowser.Align := alClient; WebBrowser.Navigate(RequestPinURL); authForm.ShowModal; authForm.free; end; Also, if you in the end decide to maintain the ShellExecute, then better specify the 'Open' verb. Some system may have the default verb defined differently. ShellExecute(0, 'open', PChar(' https://twitter.com/oauth/authorize?oauth_token=' + OAuthToken), '', '', SW_SHOWNORMAL); And you don't need to declare the ShellExecute import, just use the one defined in the ShellAPI unit. --- Why you decided to use the GPL v3? IMHO, for small , and simple, code projects like this one, better use a license that can be used in closed code applications, or commercial users will just grab/mangle the code and don't give you any credit. If credit is given, they will need to open the code too, and that isn't going to happen. On the other hand, if license permits closed code, they have no problem to include the reference. -- 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] TTwitter component
It is my understanding the GPL v3 license restricts any commercial closed source use except in the case that the GPL'ed source code is compiled into a separate library that is linked to during run-time vs. being compiled into the exe file itself. LGPL (for LesserGPL) let you link to a library without making your application source code available. This is the license a lot of library use (ex.: QT) If you use GPL code in your application, you have to license it under GPL too. It is my understanding the BSD license allows anyone to do anything with the source however you retain full copyright and ownership. For example the Mac OS X is based off of FreeBSD The BSD license let you take the code and do whatever you want with it, even making it closed source. As an example, the TCP/IP stack of Windows is closed source, but is based on the BSD stack. So if you license your code on BSD, someone could take it, compile a Delphi component with it, then call it is own and sell it. DISCALAIMER - I am not a lawyer either :) -- 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