Class: Takagi::TcpClient

Inherits:
ClientBase show all
Defined in:
lib/takagi/tcp_client.rb

Overview

CoAP-over-TCP client for testing Takagi servers with TCP transport.

This client implements CoAP over TCP (RFC 8323) with automatic length framing. Unlike the UDP client, TCP provides reliable delivery so no retransmission manager is needed.

Examples:

Basic usage with auto-close (recommended)

Takagi::TcpClient.open('coap+tcp://localhost:5683') do |client|
  client.get('/temperature')
end

Manual lifecycle management

client = Takagi::TcpClient.new('coap+tcp://localhost:5683')
begin
  client.get('/temperature')
ensure
  client.close
end

Instance Attribute Summary

Attributes inherited from ClientBase

#callbacks, #server_uri, #timeout

Method Summary

Methods inherited from ClientBase

#close, #closed?, #delete, #get, #get_json, #initialize, #observe, #on, open, #post, #post_json, #put, #put_json

Constructor Details

This class inherits a constructor from Takagi::ClientBase