Skip to main content
The TCP CoT Service provides unencrypted TCP connections for receiving Cursor-on-Target (CoT) messages from ATAK clients and other TAK devices.

Overview

The TCP CoT Service (TCPCoTServiceMain) is responsible for handling CoT communications over standard TCP connections. It listens for incoming connections, processes CoT XML messages, and distributes them to connected clients. Default Port: 8087 Protocol: TCP (unencrypted) Message Format: XML (CoT)

Service Architecture

Main Class

FreeTAKServer.services.tcp_cot_service.tcp_cot_service_main.TCPCoTServiceMain The TCP CoT service extends DigitalPyService and manages:
  • Socket creation and binding
  • Connection reception
  • Client data handling
  • Message serialization and routing
  • Component response broadcasting

Key Components

Socket Controller

Class: TCPSocketController (tcp_cot_service_main.py:167) Creates and configures TCP sockets:

Connection Model

Class: TCPCoTConnection (model/tcp_cot_connection.py:12)
Properties:
  • service_id: “tcp_cot_service”
  • protocol: “XML”
  • model_object: Event domain object
  • sock: TCP socket instance

Connection Handling

Receiving Connections

The service uses ReceiveConnections controller to accept new TCP connections (tcp_cot_service_main.py:178):

Client Reception

Class: ClientReceptionHandler (tcp_cot_service_main.py:175) Handles data reception from connected clients:
Buffer Size: 1024 bytes (tcp_cot_service_constants.py:3)

Connection Flow

  1. Socket Creation - TCP socket bound to configured IP and port
  2. Listen for Connections - Service accepts incoming connections
  3. Handle Connection - New connection processed via handle_connection() (tcp_cot_service_main.py:761)
  4. Client Registration - Client information stored in client_information_queue
  5. Data Reception - Messages received via ClientReceptionHandler
  6. Message Processing - CoT XML parsed and routed to components

Message Processing

Main Run Function

Method: mainRunFunction() (tcp_cot_service_main.py:476) Central loop that:
  • Receives new connections
  • Handles client data
  • Processes shared data from other services
  • Broadcasts component responses

Data Handling

Regular Data

Method: handle_regular_data() (tcp_cot_service_main.py:705) Processes CoT messages from clients:

Component Handler

Method: component_handler() (tcp_cot_service_main.py:276) Routes CoT data to appropriate components:
  1. Convert XML to dictionary: convert_xml_to_dict() (tcp_cot_service_main.py:416)
  2. Get human-readable type: get_human_readable_type() (tcp_cot_service_main.py:438)
  3. Create request with CoT data
  4. Send to subject for component processing

Disconnection Handling

Method: handle_disconnection() (tcp_cot_service_main.py:742) Handles client disconnections:

Service Metrics

The service tracks operational metrics (tcp_cot_service_main.py:97-106):

Monitoring

Method: monitor() (tcp_cot_service_main.py:806) Logs metrics every 15 seconds:

Configuration

Service Constants

File: configuration/tcp_cot_service_constants.py

Port Configuration

Default Port: 8087 (MainConfig.py:70)

Usage

Starting the Service

Client Connection

ATAK clients can connect using: Protocol: TCP Port: 8087 Host: FreeTAKServer IP address Example connection string:

Threading Model

The service uses a ThreadPool for concurrent operations (tcp_cot_service_main.py:171):
Two main async tasks:
  1. Connection Reception - Accepts new client connections
  2. Client Data Handler - Receives data from connected clients

Connection Type

Property: connection_type (tcp_cot_service_main.py:194)