Patent ID: 8411640

Claim:
A communication apparatus capable of connecting to one of a plurality of relay apparatuses that relays wireless communications, the communication apparatus comprising: an identification-data storage unit that stores therein first device identification data for identifying a first relay apparatus to which the communication apparatus is currently being connected, the first device identification data being unique to the first relay apparatus; a transmitting unit that transmits a request message that requests connectable relay apparatuses to return a response message; a receiving unit that receives response messages from the connectable relay apparatuses, each response message including individual device identification data of a relay apparatus that transmitted the request message; a determining unit that determines whether received response message includes individual device identification data that matches with the first device identification data stored in the identification-data storage unit; and a connection requesting unit that requests, if no received response message includes the individual device identification data that matches with the first device identification data stored in the identification-data storage unit, a second relay apparatus from among relay apparatuses identified by second device identification data that is included in any of the received response messages to make a connection with the communication apparatus, and, if a received response message includes the individual device identification data that matches with the first device identification data stored in the identification-data storage unit, the connection requesting unit maintains the connection with the first relay apparatus that is connected with the communication apparatus.