Search Unity

[Released] Sockets Under Control

Discussion in 'Assets and Asset Store' started by jemonsuarez, Oct 2, 2020.

  1. jemonsuarez

    jemonsuarez

    Joined:
    Sep 24, 2012
    Posts:
    151
    Do you need to implement communications but you don't know how?
    You can't decide what's the best network transport layer for your project?
    Does the implementation of a server gives you chills?
    Do you find the variety of libraries and frameworks overwhelming?

    So Sockets Under Control is for you: Are you ready to unveil the arcane knowledge of networking?

    Within this package you will find a complete collection of useful classes to have all imaginable Sockets Under Control:
    - UDP client/server.
    - TCP client.
    - TCP server.
    - WebSocket client.
    - WebSocket server.
    - NTP client/repeater/emulator.
    - RS232 connection helper.

    The main feature of Sockets Under Control is its level of abstraction: All of these classes are programmed/controlled in the exact same way. If you control one then you control them all. Due to this feature, they are easily interchangeable and transparent. Don't waste your time choosing one, use them all and the experience will give you the right answer.

    Every single class in this collection is prepared to work seamlessly in Unity without heavy learning curves. But if you need some advanced performance, it's available too.
    You can add connectivity to your game in no time, even if you don't have any knowledge or experience in networking.
    Check the documentation if you don't believe it.

    You can build your own methods on top of this classes, no matter what: Synchronizing players, turn based games, chat, login, video, connect with other applications or web sites, P2P, etc. using a robust & multi-platform base always.

    Main advantages of Sockets Under Control:
    - Full source code included.
    - No plugins required.
    - Simplified and intuitive workflow.
    - Completely based in standard and familiar terminology.
    - Unity Editor integration.
    - All technologies in one place.
    - IPV6 ready.
    - Includes File Transfer Server fully integrated.
    - Includes File Management fully integrated.
    - Includes Open WAV Parser fully integrated.
    - C# Visual Studio application example included.
    - Servers has no limit in concurrent incoming connections.
    - Extensive documentation.
    - Technical support.
    - Powerful networking without you losing control.
    - No third party libraries or technologies needed.
    - Learning curve reduced at minimum.
    - All classes were tested with real 100+ concurrent connections in industrial environments.
    - NTP client/repeater/emulator class included (Very important for massive multi-player synchronization or prevent cheating with system time).

    Test applications:
    - Windows.
    - Linux.
    - OSX.
    - ios (Xcode project).
    - Android.
    - WebGL (WSConnection & NTP-WS-Client only).
    - WinForms.

    If you have any question, feel free to send me an email at: jmonsuarez@gmail.com
    Documentation
     
    Last edited: Nov 21, 2022
    Morbeavus and JohnsonP like this.
  2. Desarius

    Desarius

    Joined:
    Oct 17, 2014
    Posts:
    5
    Ya Ya Nethulhu fhtagn !
     
    jemonsuarez likes this.
  3. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    It won't let me put a review in the asset store, so I put it here.

    I have bought and tried 7 different products on this subject and this is by far the best. It works fast, effective. The examples are perfectly understandable and it brings easy-to-understand server examples in its source code.

    Perfection (in my opinion) if it had SignalR. It would be absolute excellence.

    Anyway, 5 stars guaranteed.
     
    jemonsuarez likes this.
  4. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Hi, I'm working on a project where I have to control more than 100 VR Android devices that receive commands from a single server app installed on a pc, all on a local LAN.

    The commands are rather simple indeed, just some video start/stop instruction, plus a few other data that could move in both ways (the server asking the VR devices about their contents, the device state, some infos & diagnostics, and so on).

    So I would just ask if your asset could work for me. Does it work for large scale (around 150 devices) scenarios, both on local and on the internet? I guess a WS Server/Client implementation could be the best for my needs, am I right?
     
  5. jemonsuarez

    jemonsuarez

    Joined:
    Sep 24, 2012
    Posts:
    151
    Hi, you are describing a simple infrastructure that can be done using TCP or WebSockets.
    As you already realized, WebSockets seems to be the best option.

    SUC provides a WSServer class compatible with Unity, Mono or VisualStudio (WinForms, WPF, console, etc.). The WSServer class was tested on Windows and Linux servers, so you can run your server app without issues (just need to open the necessary port in the firewall).
    The WSClient is the most compatible connection available, it supports all mobile, all standalone and WebGL platforms.

    To allow more than 100 simultaneous connections you just have to set the "_maxConnections" parameter to your desired value (100 by default). I've successfully tested up to 250 simultaneous connections on a Linux server (I don't recommend more than 200 unless your hardware supports the multi-threaded load).

    The complexity of your dialog is completely out of the scope of SUC, since it allows you to send a byte array and manage the possible fragmentation transparently. The message is received on one single event without interruptions, the message content is not analyzed/altered.

    SUC also includes FileManagement, and its very useful FM_IniFile class that allows you to structure a message with key/value pairs, and group those keys on different sections. Very convenient to easily structure your protocol.

    The FM_IniFile object can be converted to string (using the separator of your preference) with the method iniFile.ToString(char separator, bool sort).
    Once the message was received on the other side it can be restored using iniFile.Parse(string message, char separator).

    The FM_IniFile provides many methods to manage the INI content fast and easy. Of course you can use XML, Json, YAML, binary, etc. but the INI parser is already included and fully integrated with SUC (INI file structure is simple, easy to read and modify manually, and can be saved to a log file for debug purposes in one line of code).

    If you have to increase the amount of clients to be connected to your server, I highly recommend distributing them on several servers acting as "nodes" which are then connecting to the main server, so you don't need to increase the cost of your hardware (also your main server remains isolated from the public access through those nodes).

    The WSServer can be used through the Internet too (it's also IPV6 ready) and it's compatible with standard WebSocket clients available on all web browsers. WebSocket is masked but not encrypted, so just make sure to have an authoritative server design to avoid possible attacks (this is not really important on local networks).

    IMPORTANT: WSServer doesn't includes a SSL/TLS encryption method, and encryption is required mostly if you are sending sensitive data, otherwise the standard masked WebSocket protocol should be enough. Have in mind that the encryption/decryption methods add process overhead to your protocol, so make sure you really need it (You can always use the included XOR encryption method using all private keys which is very safe and much faster). And don't worry, web browsers wont fire any alert for not using WSS connections (only insecure HTTP servers does).

    Please don't hesitate on sending me an email to jmonsuarez@gmail.com if you need more information.
    Best regards,
    Javier.
     
  6. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Thank you for your answer and great to hear that.

    I already bought the asset indeed and I started working on my project. Should I have some doubt I'll ask you then :)
     
    jemonsuarez likes this.