Post

Replies

Boosts

Views

Activity

Reply to IP Address
getifaddrs() will return the IPv4 & IPv6 addresses of each interface. This in most cases, especially for IPv4, will be an address on the users local network. If you're after the users public IP address you will have to use some other method, such as visiting one of the many sites on the internet, via an http(s) request, that will reply with the connecting address.
1w
Reply to FileHandle's readabilityHandler not called when detached from debugger
@eskimo Sorry to ressurect an old thread. I was just faced with this very issue trying to run a shell script using Process(). My program was waiting 10 seconds for enough data to fill the buffer before the 1 second updates from the script were presented to my read handler. On reading man setbuf, I saw a reference to setting the environment variable STDBUF. Inserting export STDBUF="U" into the script seems to have solved the problem and my program now receives each message as it is output from the shell script. I was unable to find reference to this environment variable anywhere else and am just asking for reassurance that it won't suddenly disappear.
May ’23
Reply to Windows Developer moving to macOS – please help me to start
Instead of looking to call Swift from C++ you should probably look at it the other way round. Use Swift as the main language for your development - it integrates beautifully with Interface Builder and is ideally suited for building a gui. You can then make calls to C/C++/Obj-C using the Swift bridging interfaces. Admittedly there is a bit to learn but I think you'll find Swift to be quite easy to become familiar with. I have found C/C++ to be very useful in Swift applications for dealing with Posix/System interfaces, then passing results back to Swift either as arguments or via closure/callbacks.
Sep ’22