NetTalk Central

Author Topic: connecting to multiple servers  (Read 19449 times)

pcrafton

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
connecting to multiple servers
« on: October 30, 2007, 06:08:34 AM »
I need to have my client to connect to multiple servers, n seperate locations, all running the same app all listening on the same port (Netsimple TCP Servers). I have a queue of server IP addresses, do I need a seperate Nettalk object for each server, or can I connect to each server using one netsimple object? An example if you have done this. Thanks



Thanks
 Paul

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: connecting to multiple servers
« Reply #1 on: October 31, 2007, 12:22:06 AM »
Hi Paul,

you can either create multiple objects (which might be easier for you from a conceptual point of view) or you can use the NetSimpleMultiClient class.
There is an example of this in the NetDemo app (3rdparty\examples\nettalk\demo\netdemo.app) in a procedure called TestNetSimpleMultiClient

Cheers
Bruce

pcrafton

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Re: connecting to multiple servers
« Reply #2 on: October 31, 2007, 10:00:42 AM »
Bruce:

Using The Multiclient object worked perfectly, and wasn't that hard to implement. Thanks for the heads up. Since it uses queues does it work in the same manner as wholepacketqueues in netsimple?

Thanks once again

Paul

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: connecting to multiple servers
« Reply #3 on: October 31, 2007, 10:05:22 PM »
I don't know Paul, I didn't write that code, Jono did. But the clw's are all in the \libsrc folder if you want to take a look <bg>...

cheers
Bruce