🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #5008

initialising a ClientSocket

#5008
From: duncan
Date: Thu, 11 Nov 2004 14:11
18 lines
1684 bytes
Hi, I'm using TClientSocket and TServerSocket in my application to send messages from one instance on one PC to another instance on another PC. 

I am initialising my client as below:

   file_client_pointer->Port = 7000;
   file_client_pointer->Host = host_ip_address;
   file_client_pointer->Active = true;


I have found that if I initialise the client in the 
Application->CreateForm section, then the message sending works.

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. 

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?

Any suggestions? 
Technical Details
Message-ID: <41938125$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f81efd77741cef0b,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "duncan" <no_spam@spamsucks.com>
Sender: "duncan" <no_spam@spamsucks.com>
Reply-To: "duncan" <no_spam@spamsucks.com>
Subject: initialising a ClientSocket
Newsgroups: borland.public.cppbuilder.internet.socket
X-User-Info: 194.129.249.241     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <41938125$1@newsgroups.borland.com>
Date: 11 Nov 2004 07:11:33 -0700
X-Trace: newsgroups.borland.com 1100185893 207.105.83.66 (11 Nov 2004 07:11:33 -0700)
Lines: 20
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!newsfeed.wirehub.nl!194.72.7.126.MISMATCH!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail