Documentation updated on 01/09/2023
For older plugins with versions 1.xx please click here.

For older versions of this plugin some functions might be missing or look different. I follow the marketplace rules and release updates and patches only for the latest 3 Unreal versions.
To have the documentation always available you can use the print function of your browser and create a PDF.

Start your project and check plugins.





You can optionally change the global type of the socket. Default is "System".
Auto = Unreal decides. Thirdparty platforms (Steam, Playstore etc.) will be used if configured.
System = Unreal determines the OS and selects a socket type accordingly.




All nodes are independent of each other. You can create the connection in the Gameinstance Blueprint. However, you can create the events in your Pawn Blueprint. You can also create an additional event in your UI.
The connection will be maintained even if you change levels. Pay attention to where and how often you connect and disconnect. Especially when developing multiplayer applications on one PC it can get confusing.

In this example you will see how to add an event.




TCP example. You can find this example in the Levelblueprint (SocketClientDemoTests Map) in the demo project, UE5.




Since version 2.5 there is an Async Node function with which you can avoid the Event Delegates.




It can happen that large messages are split at the receiver. Or that messages, which are sent very quickly, are combined into one. To work around the problem there is the parameter "Message Separator" with three options.

Via one Byte A byte is appended after each message. Default value is the byte 0 (0x00).
Via String A String is appended after each message. Default value is (~{.
By Lenght When this setting is selected, 5 bytes are added in front of each dataset. The first byte indicates the endianness. (0x00 = Little, 0x01 = Big). The other 4 bytes are an int32 with the length of the record.

Keep in mind that the client and server settings must match.



The separator can be changed. Must be changed before the connection is established.



UDP example. You can find this example in the Levelblueprint (SocketClientDemoTests Map) in the demo project, UE5.




Since version 2.5 there is an Async Node function with which you can avoid the Event Delegates.




You can also check via UDP if a Unreal game server is running. You can also use it to search for servers on the LAN. Please do not consider this kind of check as 100% reliable.









This plugin offers the following file/directory functions. Please make sure that not all functions work on all operating systems due to rights restrictions.




Since version 2.20 (UE4.25 and higher) there are special functions to transfer files without loading them into RAM. This allows theoretically to send infinitely large files.
For owners of the client and server plugin it will be especially comfortable. The functions provided for this communicate with each other before the file transfer and afterwards.
This allows a progress indicator, resuming of aborted transfers and there is a MD5 checksum check at the end to make sure that the file arrived undamaged.
The communication is encrypted with AES. The transfer is unencrypted.

Please note the tooltips of the function and the parameters. What the parameter "Token" means is explained in the server plugin documentation.

The "Socket Client Send File Over TCP" function establishes a connection to the server via TCP, sends the file and disconnects again.




The "Socket Client Request File Over TCP" function can be used to request a file from the server. Which file is controlled by the token. The server sends the file if all parameters are correct. The connection is also terminated here after the transmission.




There are two events. The first event is triggered when there is an error during the transfer and at the end of the transfer. The second event is fired every second during a transfer and shows the progress.




If you have only bought the client plugin, you can also read files step by step without having to load them completely into RAM. However, the communication must be created completely by yourself.
When sending a file you have to call the function "Read Bytes from File in Parts Async".

The buffer indicates the size in bytes that will be read from the file. The delay specifies how long to wait until the next part is read.
This is necessary so that reading is not too fast. With an SSD you can read several gigabytes per second.
But you can't send the data that fast. If you read too fast, the data would be buffered in some buffer (RAM) in the OS, which could lead to problems again. Just try different values if the data is read too slowly.




Since the data is read asynchronously there is an event that returns the read bytes. These bytes can be sent.




If you want to receive bytes to save them to a file you have to open a file first. When you open the file, it is automatically created and returned as a structure.
In this example a file is opened when the connection is established and closed when the connection is closed.




Write bytes from a TCP connection to an open file.




Since version 2.20 (UE4.25 and higher) you can encrypt and decrypt strings with AES 256 bit.
The encrypted string is returned as a Base64 string and accordingly a string must be Base64 to be decrypted again. The key must be 32 characters long and only ASCII characters may be used. There are AES key generators on the Internet that you can use.




Since version 2.50 (UE4.27 and higher) there is an additional thread running in the plugin that deletes disconnected connections from RAM. Here you can set whether the thread should write its work in the logs and how often it runs.




Nativization

This plugin is designed for extensive multithreading. Multithreading means that the CPU load is spread across all CPU cores so as not to affect the FPS while data is being sent and received.
Unfortunately, this leads to incopatibilty with Blueprint Nativization. Please use the Exclusive method and use the plugin only in Blueprints that are not nativized.
According to the current information, nativization will no longer exist in UE5 anyway.

Contact(ENG,GER): unrealmarketplace@virtualbird.de