Remote IP and Port of a UDP socket

BlitzMax Forums/BlitzMax Programming/Remote IP and Port of a UDP socket

I think the problem is that you do not have a socket that is bound to a remote IP and port, and above functions only work with such sockets.

Usually, to get a socket that is bound to a remote host, you'd create a local listening socket and create new sockets for each incoming request via SocketAccept(). Those new sockets carry the remote information that you want to obtain, but the problem is that this approach only works with TCP connections.

UDP was designed for so-called unreliable communication, and that basically translates to that you have an application that does not even expect a reply from the other machines that it is sending to.

It does not seem as if BlitzMax had any features implemented that would allow you to open the received UDP packages and analyze the header info. When you are writing both the server and client app, just make sure that your client app is transmitting the necessary information in its messages. If this is not the case, you will probably have to write some wrapper functions for the sockets API of your OS.