Socket.IO for Objective-C Integration and Testing Guide

Socket.IO/Objective C Library

Compatibility: This version only supports Socket.io v1.XX.

Supported Features:

- Acknowledgments

- Binary Data Handling

- Namespaces

Setting Up the Server Target

  1. Run the Server target in your project.
  2. Use the SocketIO-ObjC-Example to run some tests.

Basic Usage

Inspired by practical use cases, the simplest way to connect to a Socket.IO/node.js server is:

SocketIO *socketGlobal = [[SocketIO alloc] initWithDelegate:self host:@"localhost" port:8080 namespace:nil timeout:1000 secured:NO];
[socketGlobal connect];

Namespace Usage: You can also connect to a specific namespace:

SocketIO *socketPublic = [[SocketIO alloc] initWithDelegate:self host:@"localhost" port:8080 namespace:@"/public" timeout:1000 secured:NO];
[socketPublic connect];

This setup ensures a reliable and structured approach to using Socket.IO in Objective-C, following essential protocols for connectivity and namespace handling.

zip 文件大小:507.01KB