UDP Socket sender IP and Port

BlitzMax Forums/BlitzMax Programming/UDP Socket sender IP and Port

Figured out how.
I had heard about recvfrom, eventually got it to work.

When just reading ints from a server socket, I do:

Local sra:Int = SocketReadAvail(servSocket)
If sra > 0 Then
	Local bytes:Int[1]
	Local rip:Int = 0
	Local rport:Int = 0
	recvfrom_(servSocket._socket, bytes, sra, 0, rip, rport)
	Print "from: " + DottedIP(rip) + ": " + rport
	Print "got int: " + bytes[0]
EndIf



Hopefully this becomes a somewhat straight-forward forum post on the subject and allows the many I've seen wondering how to eventualy know.