Feature request > Network

SOCK_RECVIP - Possible?

(1/4) > >>

Such a function would be really useful - i.e. the IP address of the sender of the last message you used SOCK_RECV on.

Kitty Hello:
If you got the socket from SOCK_CONNECT, you know the IP beforehand - just remember it.
If you got it from SOCK_TCPACCEPT, the 2nd parameter has the IP - also, just remember it.

These commands will work for TCP, but not UDP.  If you need your program to respond to UDP messages, then there is currently no way to get the IP address of the sender.  I've brought this up before, and I'm simply embedding a string of IPs at the start of messages, but it would be easier to have something like SOCK_RECVIP, and this would allow GLBasic programs to communicate with others that send UDP messages.  Although this isn't terribly necessary, it would be nice to have it.  I'm not sure about how hard it is to implement though, and therefore if it's worth it.

Kitty Hello:
I think there is no way to tell where a udp message came from.

Exactly - surely the IP address of the sender must be in the header somewhere?


[0] Message Index

[#] Next page

Go to full version