Is WinSock really the best socket to use for this engine? Or is there something out there which is faster?
In Visual Basic 6, not really an alternative. In C#/VB.Net, yes the socket class or lidgren. Seeing as how there arn’t really any plans to have the engine ported to .net in the near future as it would require a complete re-write let’s go with: Yes Winsock is the best, and no there are no alternatives that arn’t wrappers of WinSock (wrappers are slower by the way).
I’ve been using Mirage 3.0.3 for my MUD. I’ve currently copied the method used in Skywyre v8 in terms of how packets are handle both server and client, assuming this would help speed up the process compared to the original bog standard method that Mirage Source used.
I’ve done some research in the past to see if there was something better than WinSock and I came across SocketWrench. I’ve never given it a try, but from what I’ve read it’s better and more efficient. It supports .NET as well as legacy applications such as VB6. Just download the ActiveX version of it. Who know, should give it a try?
I don’t think any of you understand exactly what WinSock is.
busy right now, but I’ll digress when I get a bit of time.
If you want to know a base explanation of what winsocket is this best describes it.
Basically no matter what you plan on using unless you have something that can do I/O on the low end you are stuck using winsocket. Even lidgren uses winsocket for windows. It simply just wraps around winsocket and sets the socket protocol to use UDP instead of TCP. Lidgren simply adds their own security features and reliability features to UDP which normally does not have those types of features. UDP is faster than TCP but in most cases you should not use UDP for perfect reliability as if you use something like lidgren you may end up wasting extra bandwidth trying to get a packet from one point to another if the packet did manage to get dropped as UDP is very susceptible to this.
For more information on UDP and TCP look to these links
UDP can be good if the packet can make it all the way through the first time as it can have a single large packet compared to multiple packets split up into the size of the computers MTU. This means TCP can have more overhead than UDP, but with TCP you are guaranteed that packets arrive in order and they have a smaller chance of being dropped by a server.
No need to repeat what’s already been said, just to develop it on further, System.Net.Sockets is just a wrapper around WinSock and Lidgren is more or less just a wrapper around System.Net.Sockets. Fundamental difference is that it just gets easier to use as you move up a level, and maaaaybe a negligible speed losses as you move up? (who knows. computers are blinding fast, does anybody really care massively about speed at that abstract level?)
Winsock is simply Windows’ equivalent to BSD’s Berkeley socket API, there isn’t really anything “faster” per sé without needing to make another incredibly low-level socket implementation, and if you plan on doing that, you’d need to know what Windows is doing better than the Microsoft team that implemented WinSock, but if you could do that, you wouldn’t be asking this question in the first place.
Never heard of SocketWrench, but I can’t find any benchmarks or proof to support their claim, so take it for what you will.
SocketWrench is just a C++ wrapper of winsocket and web protocols given by another library.
Has anyone ever tried to use UDP instead? Or is this not necessary for a game like what Eclipse makes? I’m just curious.
I’m noob to all this but I’m guessing winsocket restricts player numbers?
What are peoples thoughts on the packet system currently in Skywyre? I’m ripping it and putting it into my MUD to see if packet sending will improve. I have a lot of packets being sent back and forth, because obviously it’s text based, and you move from room to room which requires an update potentially every 10th of a second if you move fast enough. And the content is player data, NPCs, room descriptions (Which isn’t so bad as that’s just text strings), and other things, where as the 2D engine loads the map, NPCs and players and only really sends information on NPC movement unless you attack something or drop something, but I’d say that I’m sending 10 times more packets with this.
I’m guessing the method used in Skywyre compresses the packets to make them smaller in order to send more quickly, so anything like that would help very much. The issue I have right now is that I can kill a single monster 6 times before it registers (If I have 4 monsters spawned and 3 players in that one room), and that’s a massive exploit that I need to fix.