Patent ID: 8570895

Claim:
A communication apparatus which is connected through wireless connection to a relay apparatus that relays data, and communicates with a partner apparatus connected to the relay apparatus, said communication apparatus comprising: a measurement data transmitting unit configured to transmit (i) first measurement data to the relay apparatus, and (ii) second measurement data to the partner apparatus via the relay apparatus, the first measurement data being data for measuring a communication time between said communication apparatus and the relay apparatus, and the second measurement data being data for measuring a communication time between said communication apparatus and the partner apparatus via the relay apparatus; a response data receiving unit configured to (i) receive, from the relay apparatus, first response data that is a response to the first measurement data, and (ii) receive, from the partner apparatus via the relay apparatus, second response data that is a response to the second measurement data; a network measurement unit configured to (i) calculate, based on the first response data, a first communication time that is a communication time between said communication apparatus and the relay apparatus, and (ii) calculate, based on the second response data, a second communication time that is a communication time between said communication apparatus and the partner apparatus via the relay apparatus; a connection mode judging unit configured to judge whether or not the relay apparatus and the partner apparatus are connected through wireless connection, based on a partner section communication time that is a difference between the second communication time and the first communication time; and a connection mode switching unit configured to switch, when said connection mode judging unit judges that the relay apparatus and the partner apparatus are connected through wireless connection, the communication with the partner apparatus from indirect wireless communication to direct wireless communication, the indirect wireless communication being wireless communication via the relay apparatus, and the direct wireless communication being wireless communication not via the relay apparatus, wherein said connection mode judging unit is configured to judge that the relay apparatus and the partner apparatus are connected through wireless connection, when the partner section communication time is greater than or equal to a predetermined percentage of the first communication time.