Socket
The Socket feature enables TCP/IP socket communication for your AppBlocks application. This allows direct network connections between devices or to custom servers using standard TCP sockets.
Overview
Socket communication is useful for:
- Custom protocol implementations
- Direct device-to-device communication
- Integration with legacy systems
- Real-time data streaming
- Low-level network control
Socket Types
AppBlocks supports both client and server socket modes:
Client Mode
Connect to remote servers and exchange data using TCP/IP protocols.
Server Mode
Accept incoming connections from remote clients, enabling your device to act as a network service.
Configuration
Configure socket connections with these properties:
- Host: Remote server hostname or IP address (client mode)
- Port: TCP port number for connection
- Timeout: Connection and read timeout in seconds
Related Blocks
Work with sockets using these blocks:
- Socket Connect: Establish socket connection
- Socket Send: Send data through socket
- On Socket Data: Receive incoming data
- On Socket Event: Handle connection events
Use Cases
Common socket communication scenarios:
- Modbus TCP communication
- Custom telemetry protocols
- Database connections
- Third-party API integration
- Industrial equipment communication