Author Topic: SystemAddress  (Read 3082 times)

syedhs

  • Not-a-newbie
  • *
  • Posts: 41
  • Karma: 1
    • View Profile
SystemAddress
« on: August 29, 2007, 01:40:07 PM »
This is really tiny suggestion and can be done in less than a minute. 

SystemAddress should really disallow setting up port via .port member variable. It should be strictly done via SetBinaryAddress eg 127.0.0.1:20000. One way to do this is to have port member variable protected, and add a member function GetPort().

The reason is I have just solved one bug attributed to this one - it is easy to assign port after SetBinaryAddress line so the port is not set correctly.

Valen

  • Full Member
  • ***
  • Posts: 117
  • Karma: 5
    • View Profile
Re: SystemAddress
« Reply #1 on: September 01, 2007, 02:47:16 PM »
Even better would be to add a constructor that accepts the address and port.

syedhs

  • Not-a-newbie
  • *
  • Posts: 41
  • Karma: 1
    • View Profile
Re: SystemAddress
« Reply #2 on: September 03, 2007, 10:07:41 AM »
Okay on top of that, the littlest change would be to check if the string passed in the SetBinaryAddress (I didn't check the actual function name) whether it pass port - if it doesn;t assert! IMO, you should be able to tell the port if you want to connect to a particular computer.