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)
service_id: “tcp_cot_service”protocol: “XML”model_object: Event domain objectsock: TCP socket instance
Connection Handling
Receiving Connections
The service usesReceiveConnections 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:
Connection Flow
- Socket Creation - TCP socket bound to configured IP and port
- Listen for Connections - Service accepts incoming connections
- Handle Connection - New connection processed via
handle_connection()(tcp_cot_service_main.py:761) - Client Registration - Client information stored in
client_information_queue - Data Reception - Messages received via
ClientReceptionHandler - 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:
- Convert XML to dictionary:
convert_xml_to_dict()(tcp_cot_service_main.py:416) - Get human-readable type:
get_human_readable_type()(tcp_cot_service_main.py:438) - Create request with CoT data
- 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):- Connection Reception - Accepts new client connections
- Client Data Handler - Receives data from connected clients
Related Services
- SSL CoT Service - Secure SSL/TLS CoT connections
- CoT Message Format - CoT XML message structure
Connection Type
Property:connection_type (tcp_cot_service_main.py:194)