Hey there, I'm a college student in programmation, nearing the end of his course (See this page for more informations), and i've recently been making a network library, made in C# and available for any other .NET language. Actually, i had it all along for several months already, from version 1.0 to 2.1, but then i've rewritten it almost from scratch and decided to let everyone enjoy it !
So, I'll be copy-pasting the description i gave it from my website, if you excuse me :
Alta.Net is a C# library, compiled with the .NET Framework version 4.0. It contains several classes made to be easy to use. Currently, theres two main classes, ServerHandler and ClientHandler, which allow you to easily connect applications together (across the internet or locally) and send/receive Tcp or Udp messages, along with files. It also have several attributes, like a MaxClient property and a duplicate connection prevention mode. A recent addition is an easy to use (optional) authentication system, which allow you to retrieve the user’s username/password, for example. It use a fair amount of events to work, and should be usable within minutes.
Another class is SingleInstance, which use the two handlers mentioned above to provide an easy way to stop your application from being opened twice or more, in case it’s needed. It also allow you to send the arguments used by the non-unique instance to the actually unique one.
There is several minor classes too, like PacketReader / PacketWriter, which helps you build or read a message sent / received by the NetHandler class. Since all you receive when get a message is a serie of bytes (alongside who sent you the message), theses classes may simplify the task of making sense of it.
All in all, this library is free to use for non-commercial softwares, while not allowing modification to it.(Contact me otherwise, so we can talk about it!). Also, an MSDN-like documentation is available alongside, and some code samples have been recently added.
A lengthy tutorial can be found at the project page (So that you can make networked games and applications in no time!), alongside the Changelogs and a link to recent news about the library.
So hey, if you have any comments / suggestions / bugs, feel free to leave a reply, here or on the website !
"If you aren't ashamed of what you coded 6 months ago, you aren't progressing as much as you should." - My Website : Altar-Apps,Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
Well, nothing stop you from using the library for a VB.NET project, perfectly even, BUT the tutorial is told with C# in mind. Sorry for that. :smile.gif:
How would using this differ from using the classes in System.Net and System.Net.Sockets?
- It make sure that all messages sent are reconstructed as they were (for a TCP usage, anyway). Informations are sent as a stream via the socket, without any indication of the beginning and end of a packet. You could send two messages : "Hello World!" and "Welcome to X!". On one receive of a socket, you could receive "Hello W" and another "orld!Welcome to" and yet another "X!" without any idea where does each message begin and end. I had an article explaining this better than i do : Message Framing.
- It simplify the handling of clients for a server, as it manage itself the new and lost client connections. The user only need to handle some events, with enough informations within to identify the client related to it.
- Theres a small duplicate ip prevention system, which does not allow two clients to have the same IP. It's not foolproof, as an IP can be spoofed, but it's better than nothing. I've got ideas for the future to enforce something better.
- I must admit that the PacketWriter/Reader classes are pretty much simple wrappers around a duo of MemoryStream and BinaryWriter/Reader. These are not the most useful ever classes, but they can save some coding.
- The SingleInstance class remove you much of the difficulty of allowing only one instance of your application/game to run, while being able to send the Main's arguments of the not-unique instance to the unique one, if necessary.
- I probably forgot some stuff.
Rollback Post to RevisionRollBack
"If you aren't ashamed of what you coded 6 months ago, you aren't progressing as much as you should." - My Website : Altar-Apps,Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
I got a new version! :biggrin.gif: And a rather important one, as it improve security / performance and remove severe bugs. So, if any of you downloaded the library, i suggest you update with this one. And here's the changelog, taken from readme.txt :
# 2.4.0.0 #
- Two more NetHandler property, MaxMessageSize and MaxFileSize of type integer, allow you to avoid OutOfMemoryExceptions by receiving malignantly a 2 GB message, for example. When a too much big message or file header is received, the client is kicked / disconnected. Works as a server or a client.
- Yet again two more NetHandler property, ServerKeepAlive and ClientKeepAlive of type integer. For another wholy different security reason, this shall prevent half-open connection problems, which are prevalent in wifi settings. The property is the interval of time (in seconds) in which the server or client will check the connection. Default is 30 seconds.
- Separated the PacketType enumeration into PacketType (private) and MessageSize (public). Reason is that the File value was never used publicly, and in fact, the KeepAlive properties described above would only add to it.
- When broadcasting messages as a server, the packets are no longer re-created for each client.
- I Detected some bugs when receiving many TCP messages at once, with specific situations.
- File receiving is now that much more robust. (Sent and received 1000 times a 1.5kb file (to and from the same computer, so it's not the best representation of performance) with varying degree of simulated fragmentation, all of that in around 850 ms when there was the least amount of fragmentation)
Rollback Post to RevisionRollBack
"If you aren't ashamed of what you coded 6 months ago, you aren't progressing as much as you should." - My Website : Altar-Apps,Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
Well despise the lack of reaction, i've made a new version, 2.5.0.0! It's a rather big one, so i won't bother copy-pasting the changelog. Read it at the project page!
If you still want to hear about the main features, here's a short list :
- The library changed name, from NetHandlers to Alta.Net. Mostly to avoid confusion.
- Servers can demand the hardware ID of the client, to further identify it.
- The progress of a downloaded file can be reported via events.
- Events have been slightly overhauled to be easier to maintain.
- Added an authentication system, which allow the server to ask a client for it's authentication informations, such as username/password/'whatever else the server want'.
I've also updated and re-formatted the project page to compress the changelog area and most importantly, the tutorial, which make it that more readeable.
Again, if you have any comments, suggestions, bug reports, you can tell me in this thread or via my website!
"If you aren't ashamed of what you coded 6 months ago, you aren't progressing as much as you should." - My Website : Altar-Apps,Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
I decided to bring back the attention of this thread by saying that a new version arrived, 2.6.0.0 ! I've taken the liberty of copy-pasting a part of the news post i made on my blog :
I’ve made yet another version of my Network Library, Alta.Net, and now reached a point where i don’t really know what to add, so i’ll be relaxing on the updates.
What’s new in this version? Simply, theres been a major separation of the nethandler class, now being ServerHandler and ClientHandler. It helps identifying the role of each one, and allow me to optimize some of the inner working. In the same vein, i’ve shortened many a properties, events and methods name, to remove “Client” or “Server” in it, as it’s now rather redoundant.
I’ve also rewritten SingleInstance. It work the exact same way, but it’s now that much more reliable. I’ve also added a SynchronizingObject property, instead of assuming you always used it in a windows form application.
As usual, a bunch of bugfixes, too.
So hey, if you get to try it, tells me what you think of it! :biggrin.gif:
Oh, also, i'll be making a game soon enough, using it. Probably a rogue-like, with cooperative multiplayer support (think 2 to 4 players). It's still in the brainstorming stage, though.
Rollback Post to RevisionRollBack
"If you aren't ashamed of what you coded 6 months ago, you aren't progressing as much as you should." - My Website : Altar-Apps,Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
I've decided to resurrect this thread from it's four months old sleep, as there is a new version of the library. Albeit it being rather small, maybe someone would be interested in it. :smile.gif:
So yeah, 2.6.1.0 is available! It fix a whole bunch of bugs, while adding a few features that aren't app-breaking, but still nice to have.
I've concidered it and decided to go for a large rewrite for the next version, 3.0.0.0. There is so much i can add to this library, but i feel like the way i'm doing it now is limiting advancement.
You can get the new version HERE! As always, a tutorial is available, both within the package and online (online one recommended), and some code samples are there too.
"If you aren't ashamed of what you coded 6 months ago, you aren't progressing as much as you should." - My Website : Altar-Apps,Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
I've not looked at your library, but if it doesn't have it already, you should make it able to transport objects back and forth, using Serialization; use a BinaryFormatter to serialize and deserialize to/from the networkstream. Heck, you could try to save space/time by running it through the GZipStream filter class too.
That's looks like a pretty good idea! I'll definitely add it in the next version. Thanks! :biggrin.gif:
Rollback Post to RevisionRollBack
"If you aren't ashamed of what you coded 6 months ago, you aren't progressing as much as you should." - My Website : Altar-Apps,Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
----
Alta.NET, NETWORK .NET LIBRARY
Latest Version : 2.6.1.0 [February 12, 2012]
View the project page : View Project (tutorial and download)
View all news of this project : View Category
View Project's Homepage : www.altarapp.com
----
So, I'll be copy-pasting the description i gave it from my website, if you excuse me :
A lengthy tutorial can be found at the project page (So that you can make networked games and applications in no time!), alongside the Changelogs and a link to recent news about the library.
So hey, if you have any comments / suggestions / bugs, feel free to leave a reply, here or on the website !
- My Website : Altar-Apps, Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
Well, nothing stop you from using the library for a VB.NET project, perfectly even, BUT the tutorial is told with C# in mind. Sorry for that. :smile.gif:
- It make sure that all messages sent are reconstructed as they were (for a TCP usage, anyway). Informations are sent as a stream via the socket, without any indication of the beginning and end of a packet. You could send two messages : "Hello World!" and "Welcome to X!". On one receive of a socket, you could receive "Hello W" and another "orld!Welcome to" and yet another "X!" without any idea where does each message begin and end. I had an article explaining this better than i do : Message Framing.
- It simplify the handling of clients for a server, as it manage itself the new and lost client connections. The user only need to handle some events, with enough informations within to identify the client related to it.
- Theres a small duplicate ip prevention system, which does not allow two clients to have the same IP. It's not foolproof, as an IP can be spoofed, but it's better than nothing. I've got ideas for the future to enforce something better.
- I must admit that the PacketWriter/Reader classes are pretty much simple wrappers around a duo of MemoryStream and BinaryWriter/Reader. These are not the most useful ever classes, but they can save some coding.
- The SingleInstance class remove you much of the difficulty of allowing only one instance of your application/game to run, while being able to send the Main's arguments of the not-unique instance to the unique one, if necessary.
- I probably forgot some stuff.
- My Website : Altar-Apps, Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
# 2.4.0.0 #
- Two more NetHandler property, MaxMessageSize and MaxFileSize of type integer, allow you to avoid OutOfMemoryExceptions by receiving malignantly a 2 GB message, for example. When a too much big message or file header is received, the client is kicked / disconnected. Works as a server or a client.
- Yet again two more NetHandler property, ServerKeepAlive and ClientKeepAlive of type integer. For another wholy different security reason, this shall prevent half-open connection problems, which are prevalent in wifi settings. The property is the interval of time (in seconds) in which the server or client will check the connection. Default is 30 seconds.
- Separated the PacketType enumeration into PacketType (private) and MessageSize (public). Reason is that the File value was never used publicly, and in fact, the KeepAlive properties described above would only add to it.
- When broadcasting messages as a server, the packets are no longer re-created for each client.
- I Detected some bugs when receiving many TCP messages at once, with specific situations.
- File receiving is now that much more robust. (Sent and received 1000 times a 1.5kb file (to and from the same computer, so it's not the best representation of performance) with varying degree of simulated fragmentation, all of that in around 850 ms when there was the least amount of fragmentation)
- My Website : Altar-Apps, Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
If you still want to hear about the main features, here's a short list :
- The library changed name, from NetHandlers to Alta.Net. Mostly to avoid confusion.
- Servers can demand the hardware ID of the client, to further identify it.
- The progress of a downloaded file can be reported via events.
- Events have been slightly overhauled to be easier to maintain.
- Added an authentication system, which allow the server to ask a client for it's authentication informations, such as username/password/'whatever else the server want'.
I've also updated and re-formatted the project page to compress the changelog area and most importantly, the tutorial, which make it that more readeable.
Again, if you have any comments, suggestions, bug reports, you can tell me in this thread or via my website!
- My Website : Altar-Apps, Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
I’ve made yet another version of my Network Library, Alta.Net, and now reached a point where i don’t really know what to add, so i’ll be relaxing on the updates.
What’s new in this version? Simply, theres been a major separation of the nethandler class, now being ServerHandler and ClientHandler. It helps identifying the role of each one, and allow me to optimize some of the inner working. In the same vein, i’ve shortened many a properties, events and methods name, to remove “Client” or “Server” in it, as it’s now rather redoundant.
I’ve also rewritten SingleInstance. It work the exact same way, but it’s now that much more reliable. I’ve also added a SynchronizingObject property, instead of assuming you always used it in a windows form application.
As usual, a bunch of bugfixes, too.
So hey, if you get to try it, tells me what you think of it! :biggrin.gif:
Oh, also, i'll be making a game soon enough, using it. Probably a rogue-like, with cooperative multiplayer support (think 2 to 4 players). It's still in the brainstorming stage, though.
- My Website : Altar-Apps, Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
So yeah, 2.6.1.0 is available! It fix a whole bunch of bugs, while adding a few features that aren't app-breaking, but still nice to have.
I've concidered it and decided to go for a large rewrite for the next version, 3.0.0.0. There is so much i can add to this library, but i feel like the way i'm doing it now is limiting advancement.
You can get the new version HERE! As always, a tutorial is available, both within the package and online (online one recommended), and some code samples are there too.
- My Website : Altar-Apps, Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!
- My Website : Altar-Apps, Applications, Libraries, APIs, Code snippets and the Heart of Sin roguelike game!