Quote: "Is that what you mean? I'll try it tomorrow, sure does look good "
No... but IT DOES look good.
I know writing sockets can be a pain - but Winsock is the Heart... on windows at least - everything else is a wrapper...
I mean taking a stab at actually writing to Winsock itself. This is what I think I'm going to do when I get that far- you're way ahead of me in your game dev I think - I'm still in "Make Fancy Level Editor" mode .... more precisely "Make GUI" mode for editor and game.
In FreePascal they have a open source "sockets" "unit" that I like because its platform independant - (write once never touch it again) ... but then I switched to C++ for DarkGDK.. so.. I might need to write to WinSock.. Which I have done before directly in FreePascal as well.. so I'm sure I could do it in C++...
It was hard... but it was only like 4 routines that were kinda hard... I made them easy to call like the plugins usually do... and after that is was smooth sailing.
Just the nitty gritty of making a port listen, grabbing a packet that arrives, seeing if its POSSIBLY one you care about (check a header for some code you place in your packets to self ID them) then you pass the data back to your app... The reason you have to do a couple "filtering" steps with UDP is because once you turn it on - you
may recieve tons of packets that aren't yours... depending on the port you use. Then... you can't 100% trust the HEADER scan thingy - because you might occasionally get a packet that LOOKS like one of yours... then you start to do what you do - and CRASH because ... well.. it didn't have data you expected here or there because it was a fluke it got past your filter... so you need to code some safety into your routine that actually plays with the data you got in a packet so your program doesn't randomly crash.
I REALLY think you ought bite the bullet and hunker down and try to get this working directly with WinSock - the speed can't be topped - and once you "Git-R-Dun" you won't likely use a plug in for this (in C++ anyways) EVER again.
It wasn't that hard... it was but not like miles of code - just CAREFUL code... like maybe 300 lines and you will have a SOLID network interface... like those plugins.
One reason to do it yourself - I'm sure you know - is the benefits that come from knowing the insides and outs of the code and being able to look under the hood when ever you want. Usually helps track down bugs...for me anyways... when I hand something to a "Black Box" and it doesn't work how I thought it should... it takes a lot of testing before I can rule out my own issues and its a bug in the "Black Box" PLUS... in those situations... you can't do anything about it.
From our other conversations I KNOW your program's multi-play is going to be top notch and ready reasonably fast... I think you'd be one of the people who would be glad they just hunkered down and figured it out.