how to bind my ip address to a udp server in qt creator

100 views Asked by At

I want to code a UDP server and I want to use my IP address as the address of the server without putting the code the address in raw.

myIP="192.168.1.38";

is there any way to get the IP of the host machine ?

i know that QHostAddress::LocalHost is equivalent to 127.0.0.1. is there any method that works the same to get my IP ?

0

There are 0 answers