I’ll let you know: I’m building my own system on top of Hazel, but I didn’t try it yet on Unity.
Seems to just be that Unity’s Mono hasn’t implemented the SendToAsync method that Hazel used so they just threw an UnsupportedOperationException (thanks Mono!)
Interesting that it worked in editor but not build… Pushed to GitHub!
By request, Hazel is now available through NuGet!
(I messed up the versioning, apologies!)
Hazel now supports timeouts on Connect!
Also, in my infinite wisdom I messed up the versioning on NuGet even further so if you would like to update then please use for this release
Update-Package DarkRiftNetworking.Hazel -Version 0.0.0-beta
to get the latest version…
I can Start a server in Unity, and a Server/Client in windows console app —They work fine, but if I try to start a Client in Unity it freezes on Connect()
If I close the server, the client goes on its mary way…
NetworkEndPoint endPoint = new NetworkEndPoint(“127.0.0.1”, 4296);
connection = new TcpConnection(endPoint);
connection.DataReceived += DataReceived;
connection.Connect(); //<--------------------------------------------------------------FREEZES (in till server is shutdown)
connection.SendBytes(new byte[ ] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
connection.Close();
Hey, are you using the latest update from GitHub/NuGet because I changed things in Connect and it may very well be that that’s causing problems…!
Yes, got it yesterday
EDIT: so it was completely my fault…I had just commented out code in Darkrift/embeddedcubedemo…and replaced it with hazel…BUT in the main camera there was a script trying to connect with darkrift…
Jamster, have you given any thought to .NET Core compatibility in Hazel? Core is the future; minimal and performant. The perfect match for Unity.
As I mentioned on GitHub I’ll probably do it at a later date so that DarkRift can work for .NET Core rather than Mono in the future
Fragmented messages have been added!
This will probably be the last minor release in beta, the next release will likely be production (aside from fixes). I’ve also started adding releases to the GitHub page, have updated the Nuget release and updated the documentation (it was a bit behind!).
Happy New Year
Jamie
Turns out at some point I changed the UDP resend timeout to 200, that I think broke stuff so a fix has been released t all channels!
Jamie
I’ve added a bug fix on disconnections in UDP and a few minor refactorings
Looks pretty neat. I’ve just been looking at GameSparks’s real-time API, but it seems fairly low-level to me… if I have to do all that, I think I may as well use Hazel.
Is there any reason I can’t use Hazel in a peer-to-peer mode? That is, have the “server” actually be one of the clients, to which all the other clients connect? This would be intended mainly for LAN play, though I suppose you could use it over a WAN with appropriate firewall/router settings.
…OK, I give up. Where is the documentation? All the links in the repo point to http://www.darkriftnetworking.com/docs, which is 404 Not Found. And so I tried lopping /docs off of that URL, but that produces a 403 Forbidden error. It appears you have a domain name and web server, but no actual home page (index.html or similar) there?
Is this project even still alive?
Hey Joe, Hazel will work for LAN but there’s no NAT punch through so if you wanted to implement anything over the internet your users would have to port forward their routers as you say.
The project is still very much alive its just my website hosts are pretty useless and have changed a setting on the server which has broken my site again… Sorry!
ADDED: The documentation is auto generated from the docs folder using Sandcastle, any information online is also in there!
Website should be back online, it appears they replaced the entire contents of the website with a single, undeletable folder…
Sure. My thinking was, if this project ever gets serious enough, I would probably try NAT Traversal to solve that issue.
Hah. Yep, looks good now; thanks for the quick fix. I spent last evening looking at a lot of different networking options, but honestly, I think Hazel is the right level for me. I’ll let you know how it goes!
Ran into a compiler error upon adding the code to Unity:
By the way, I do quite appreciate that you’re making Hazel generic C# code, such that one could build a command-line server. I can see all sorts of uses for that. But, of course it needs to work in Unity too.
It looks like I can fix this error by changing UdpConnection.cs:13 to
public int FragmentSize { get { return 65507 - 1 - 2 - 2 - 2; } }
But now I have several more errors in the examples, all along the lines of:
But deleting the DocIncludes folder seems to have fixed that.
For the future, I might suggest either a Unity QuickStart doc that tells you what to import into Unity, or maybe a restructuring of the file hierarchy so that there is an obvious folder that contains everything you need, and nothing you don’t (e.g. “Source” or similar).
Anyway, all errors gone now… super excited!
OK, first real question.
How do I find out the IP address my UdpConnectionListener is listening on? This should be the address that clients type in to connect.
I tried displaying (listener as UdpConnectionListener).EndPoint, but this just shows 0.0.0.0 (and the correct port number).
I know there are standard ways of finding local IP addresses, but on a machine with multiple network interfaces, it can be hard to find out which IP address the server is actually listening on. Isn’t there some way to get this from Hazel?
0.0.0.0 means that it’s listening on all IP addresses. It’s a “meta-address”. If you want to listen on a specific IP address, you specify it, the library doesn’t pick it. Most network software works this way.