Article View: borland.public.cppbuilder.internet.socket
Article #5009Re: initialising a ClientSocket
From: hans galema
Date: Thu, 11 Nov 2004 16:49
Date: Thu, 11 Nov 2004 16:49
25 lines
2027 bytes
2027 bytes
duncan wrote: > file_client_pointer->Port = 7000; Do you mean ? ClientSocket1->Port = 7000; > I have found that if I initialise the client in the > Application->CreateForm section, then the message sending works. That is about the worst place to do that. You better never use OnCreate()/OnDestroy(). > However if I initialise my client after this, (dynamically), say in the OnClick method of a button, then the file_client_pointer is never Active and no messages get sent because no connection is made. If you had wrapped your lines it would have been easier to reply selective. When do you send your message then ? Better not in the same OnClick but in OnConnect. > I really need to have the ability to dynamically connect to another PC as the user will be given the choice of which PC he would like to talk to? Of course that is possible. Hans.
Technical Details
Message-ID:
<41939804@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news.glorb.com!news.zanker.org!news.cambrium.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41938125$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f81efd77741cef0b X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 11 Nov 2004 17:49:15 +0100 From: hans galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: initialising a ClientSocket References: <41938125$1@newsgroups.borland.com> In-Reply-To: <41938125$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 129.125.201.248 Message-ID: <41939804@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1100191748 129.125.201.248 (11 Nov 2004 08:49:08 -0700) Lines: 25 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news.glorb.com!news.zanker.org!news.cambrium.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail