TCP/UDP question

BlitzMax Forums/BlitzMax Programming/TCP/UDP question

I've made my own client/server before with TCP, and now I'm trying to make one with UDP but I'm having some trouble.

How can I identify where the UDP connection comes from? The function SocketRemoteIP(udpsocket) always seem to be zero, even if there's a connection active on the socket.

In TCP I would use SocketAccept(mytcpsocket) to check if a connection had been made, but this does not, according to the docs, work with UDP.

I just wanna know basically, if it's possible in some way to distinguish connections to an UDP socket. If I want to make a multiplayer game, it would be nice to know who or what is sending to the socket.. Am I making sense?

I would like to know this as well, the networking system of BlitzMax doesnt seem to be well documented. Is there a demo that shows a server/client system using sockets etc.

Blitz3d and Blitz+ had simple connection commands that were easy to follow and use the new system seems overly complicated.

If you interested in it, BNetEx:
http://www.blitzbasic.com/Community/posts.php?topic=50723
(UDP examples includet)

It's very easy to detect, where is the sender:
MyUDPStream.RecvMsg()
Print TNetwork.StringIP(MyUDPStream.GetMsgIP())
Print MyUDPStream.GetMsgPort()

I use BNetEx successfully in a gameserver and in a spider on a Unix server. The spider runs 24h of every day and spiders tausends of website content(registered websites).

cu olli

Thanks vertex, I'll dig through the code of bnetex to see how they come up with the source ip..

Make the initial connection with TCP then use the info from that to switch to UDP.

interesting idea :)

Yeah I hadn't thought of that, I think I'll give it a try.. Doesn't seem like people know how to get the connecting client info any other way :(