pnoltes commented on a change in pull request #389:
URL: https://github.com/apache/celix/pull/389#discussion_r782453462



##########
File path: bundles/pubsub/pubsub_admin_tcp/README.md
##########
@@ -0,0 +1,112 @@
+---
+title: PSA TCP 
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# PUBSUB-Admin TCP 
+
+---
+
+## Description
+
+The scope of this description is the TCP PubSub admin. 
+
+The TCP pubsub admin is used to transfer user data transparent via TCP.
+
+### IP Addresses 
+
+To use TCP, 1 IP address is needed:
+This is the IP address that is bound to an (ethernet) interface (from the 
publisher). 
+This IP address is defined with  the `PSA_IP` property.
+For example: `PSA_IP=192.168.1.0/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used
+by the pubsub admin for searching the network interfaces.
+
+Note the port will be automatically assigned, when none is specified.
+A fixed port can be assigned for example with: `PSA_IP=192.168.1.0/24:34000`.
+
+
+### Discovery
+
+When a publisher wants to publish a topic a TopicSender and publisher endpoint 
is created by the Pubsub Topology Manager.
+When a subscriber wants to subscribe to topic a TopicReceiver and subscriber 
endpoint is created by the Pubsub Topology Manager.
+The endpoints are published by the PubSubDiscovery within its topic in ETCD 
(i.e. udp://192.168.1.20:40123).
+A subscriber, interested in the topic, is informed by the TopologyManager that 
there is a new endpoint. 
+The TopicReceiver at the subscriber side creates a listening socket based on 
this endpoint.
+Now a data-connection is created and data send by the publisher will be 
received by the subscriber.  
+
+### Static endpoint
+
+TCP pubsub admin also be used as a static endpoint that can be used to 
communicate with external
+TCP publish/subsribers that don't use Discovery.
+---
+With the `tcp.static.bind.url` property, the static UDP bind can be 
configured. 

Review comment:
       Replace `tcp.static.bind.url` with `udp.static.bind.url`

##########
File path: bundles/pubsub/integration/CMakeLists.txt
##########
@@ -188,6 +188,90 @@ if (BUILD_PUBSUB_PSA_UDP_MC)
     #setup_target_for_coverage(pubsub_udpmc_tests SCAN_DIR ..)
 endif()
 
+if (BUILD_PUBSUB_PSA_UDP)
+    add_celix_container(pubsub_udp_tests
+        USE_CONFIG #ensures that a config.properties will be created with the 
launch bundles.
+        LAUNCHER_SRC 
${CMAKE_CURRENT_LIST_DIR}/gtest/PubSubIntegrationTestSuite.cc
+        DIR ${CMAKE_CURRENT_BINARY_DIR}
+        PROPERTIES
+        LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
+        CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
+        BUNDLES
+        Celix::celix_pubsub_serializer_json
+        Celix::celix_pubsub_protocol_wire_v2
+        Celix::celix_pubsub_topology_manager
+        Celix::celix_pubsub_admin_udp
+        Celix::shell
+        Celix::shell_tui
+        pubsub_sut
+        pubsub_tst
+        )
+    target_link_libraries(pubsub_udp_tests PRIVATE Celix::pubsub_api Jansson 
Celix::dfi GTest::gtest GTest::gtest_main)
+    target_include_directories(pubsub_udp_tests SYSTEM PRIVATE gtest)
+
+    add_celix_container(pstm_deadlock_udp_test
+        USE_CONFIG #ensures that a config.properties will be created with the 
launch bundles.
+        LAUNCHER_SRC 
${CMAKE_CURRENT_LIST_DIR}/pstm_deadlock_test/test_runner.cc
+        DIR ${CMAKE_CURRENT_BINARY_DIR}
+        PROPERTIES
+        LOGHELPER_STDOUT_FALLBACK_INCLUDE_DEBUG=true
+        CELIX_LOGGING_DEFAULT_ACTIVE_LOG_LEVEL=trace
+        BUNDLES
+        Celix::celix_pubsub_serializer_json
+        Celix::celix_pubsub_protocol_wire_v2
+        Celix::celix_pubsub_topology_manager
+        Celix::celix_pubsub_admin_udp
+        Celix::shell
+        Celix::shell_tui
+        )
+    target_compile_definitions(pstm_deadlock_udp_test PRIVATE 
-DDEADLOCK_SUT_BUNDLE_FILE=\"${DEADLOCK_SUT_BUNDLE_FILE}\")
+    target_link_libraries(pstm_deadlock_udp_test PRIVATE Celix::pubsub_api 
Jansson Celix::dfi GTest::gtest GTest::gtest_main)
+    target_include_directories(pstm_deadlock_udp_test SYSTEM PRIVATE 
pstm_deadlock_udp_test)
+
+    #Note we do not link to bundles, as result (to ensure a bundle zip file is 
created) an dependency on the bundle is needed.
+    add_dependencies(pstm_deadlock_udp_test pubsub_deadlock_sut_bundle)
+
+    #Framework "bundle" has no cache dir. Default as "cache dir" the cwd is 
used.
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/msg.descriptor 
${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_udp_gtest/META-INF/descriptors/msg.descriptor
 COPYONLY)
+    
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta_data/deadlock.scope.properties 
${CMAKE_CURRENT_BINARY_DIR}/pstm_deadlock_udp_gtest/META-INF/topics/pub/deadlock.properties
 COPYONLY)
+
+    add_test(NAME pstm_deadlock_udp_test COMMAND pstm_deadlock_udp_test 
WORKING_DIRECTORY $<TARGET_PROPERTY:pstm_deadlock_udp_test,CONTAINER_LOC>)
+    setup_target_for_coverage(pstm_deadlock_udp_test SCAN_DIR ..)
+
+    add_test(NAME pubsub_udp_tests COMMAND pubsub_udp_tests WORKING_DIRECTORY 
$<TARGET_PROPERTY:pubsub_udp_tests,CONTAINER_LOC>)
+    setup_target_for_coverage(pubsub_udp_tests SCAN_DIR ..)
+
+    add_celix_container(pubsub_udp_v2_endpoint_tests

Review comment:
       why is this called `v2`. I know we had v1 and v2 PSA versions when 
working towards a new way of pubsub message serialisation, but I think this 
tests something different (pubsub_loopback, pubsub_serializer)

##########
File path: bundles/pubsub/pubsub_admin_tcp/README.md
##########
@@ -0,0 +1,112 @@
+---
+title: PSA TCP 
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# PUBSUB-Admin TCP 
+
+---
+
+## Description
+
+The scope of this description is the TCP PubSub admin. 
+
+The TCP pubsub admin is used to transfer user data transparent via TCP.
+
+### IP Addresses 
+
+To use TCP, 1 IP address is needed:
+This is the IP address that is bound to an (ethernet) interface (from the 
publisher). 
+This IP address is defined with  the `PSA_IP` property.
+For example: `PSA_IP=192.168.1.0/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used
+by the pubsub admin for searching the network interfaces.
+
+Note the port will be automatically assigned, when none is specified.
+A fixed port can be assigned for example with: `PSA_IP=192.168.1.0/24:34000`.
+
+
+### Discovery
+
+When a publisher wants to publish a topic a TopicSender and publisher endpoint 
is created by the Pubsub Topology Manager.
+When a subscriber wants to subscribe to topic a TopicReceiver and subscriber 
endpoint is created by the Pubsub Topology Manager.
+The endpoints are published by the PubSubDiscovery within its topic in ETCD 
(i.e. udp://192.168.1.20:40123).
+A subscriber, interested in the topic, is informed by the TopologyManager that 
there is a new endpoint. 
+The TopicReceiver at the subscriber side creates a listening socket based on 
this endpoint.
+Now a data-connection is created and data send by the publisher will be 
received by the subscriber.  
+
+### Static endpoint
+
+TCP pubsub admin also be used as a static endpoint that can be used to 
communicate with external
+TCP publish/subsribers that don't use Discovery.
+---
+With the `tcp.static.bind.url` property, the static UDP bind can be 
configured. 
+For TCP the publisher topic properties should configure the 
`udp.static.bind.url` property to configure TCP bind interface
+that accepts incomming connections.
+
+---
+With the `udp.static.connect.urls` property, the static TCP connections can be 
configured. (Note The urls are space separate)
+For TCP the subscriber topic properties should configure the 
`udp.static.connect.urls` property 
+to configure TCP connections that subsribe to the data.
+
+---
+Note a special/dedicated protocol service implemenation can be used to 
communcate with external publisher/subscribers 
+
+---
+
+## Passive Endpoints
+
+Each TCP pubsub publisher/subscriber can be comfigured as a passive endpoint. 
+A passive endpoint reuses an existing socket of a publisher/subscriber using 
properties.
+This can be used to support full duplex socket connections.
+This can be used for both discovery and static end points.
+
+The topic `tcp.passive.key` property defines the unique key to select the 
socket.

Review comment:
       I think this is also useable for UDP, but not for ZMQ. Correct? 

##########
File path: bundles/pubsub/pubsub_admin_tcp/README.md
##########
@@ -0,0 +1,112 @@
+---
+title: PSA TCP 
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# PUBSUB-Admin TCP 
+
+---
+
+## Description
+
+The scope of this description is the TCP PubSub admin. 
+
+The TCP pubsub admin is used to transfer user data transparent via TCP.
+
+### IP Addresses 
+
+To use TCP, 1 IP address is needed:
+This is the IP address that is bound to an (ethernet) interface (from the 
publisher). 
+This IP address is defined with  the `PSA_IP` property.
+For example: `PSA_IP=192.168.1.0/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used
+by the pubsub admin for searching the network interfaces.
+
+Note the port will be automatically assigned, when none is specified.
+A fixed port can be assigned for example with: `PSA_IP=192.168.1.0/24:34000`.
+
+
+### Discovery
+
+When a publisher wants to publish a topic a TopicSender and publisher endpoint 
is created by the Pubsub Topology Manager.
+When a subscriber wants to subscribe to topic a TopicReceiver and subscriber 
endpoint is created by the Pubsub Topology Manager.
+The endpoints are published by the PubSubDiscovery within its topic in ETCD 
(i.e. udp://192.168.1.20:40123).
+A subscriber, interested in the topic, is informed by the TopologyManager that 
there is a new endpoint. 
+The TopicReceiver at the subscriber side creates a listening socket based on 
this endpoint.
+Now a data-connection is created and data send by the publisher will be 
received by the subscriber.  
+
+### Static endpoint
+
+TCP pubsub admin also be used as a static endpoint that can be used to 
communicate with external
+TCP publish/subsribers that don't use Discovery.
+---
+With the `tcp.static.bind.url` property, the static UDP bind can be 
configured. 
+For TCP the publisher topic properties should configure the 
`udp.static.bind.url` property to configure TCP bind interface
+that accepts incomming connections.
+
+---
+With the `udp.static.connect.urls` property, the static TCP connections can be 
configured. (Note The urls are space separate)
+For TCP the subscriber topic properties should configure the 
`udp.static.connect.urls` property 
+to configure TCP connections that subsribe to the data.
+
+---
+Note a special/dedicated protocol service implemenation can be used to 
communcate with external publisher/subscribers 
+
+---
+
+## Passive Endpoints
+
+Each TCP pubsub publisher/subscriber can be comfigured as a passive endpoint. 
+A passive endpoint reuses an existing socket of a publisher/subscriber using 
properties.
+This can be used to support full duplex socket connections.
+This can be used for both discovery and static end points.
+
+The topic `tcp.passive.key` property defines the unique key to select the 
socket.
+The `tcp.passive.key` property needs to be defined both in the topic 
properties of the topic connections that will be shared.
+and the topic properties of the 'passive' topic that will re-use the 
connection.
+The `tcp.passive.configured` topic property will indicate that is topic is 
passive and will re-use the connections
+indicated with the `tcp.passive.key` property
+
+For example: `tcp.passive.key=udp://localhost:9500` and 
`tcp.passive.configured=true`

Review comment:
       why a url as key. I think anything can be a key and by giving the 
example a `udp://localhost:9500` this conveys this this key is used for socket 
connections.. but it just a "id" / "key".

##########
File path: bundles/pubsub/pubsub_admin_udp/README.md
##########
@@ -0,0 +1,149 @@
+---
+title: PSA UDP 
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# PUBSUB-Admin UDP 
+
+---
+
+## Description
+
+The scope of this description is the UDP PubSub admin. 
+
+The UDP pubsub admin is used to transfer user data transparent via UDP 
unicast, UDP broadcast and UDP multicast.
+UDP support packets with a maximum of 64kB . To overcome this limit the admin 
uses a protocol service on top of UDP 
+which fragments the data to be send and these fragments are reassembled at the 
reception side.
+
+### IP Addresses Unicast
+
+To use UDP-unicast, 1 IP address is needed:
+This is the IP address that is bound to an (ethernet) interface (from the 
subscriber). 
+This IP address is defined with  the `PSA_IP` property.
+For example: `PSA_IP=192.168.1.0/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used
+by the pubsub admin for searching the network interfaces.
+
+Note the port will be automatically assigned, when none is specified.
+A fixed port can be assigned for example with: `PSA_IP=192.168.1.0/24:34000`.
+
+### IP Address Mulicast
+
+To use UDP-multicast 2 IP addresses are needed:
+
+1. The multicast address (in the range 224.X.X.X - 239.X.X.X)
+2. IP address which is bound to an (ethernet) interface (from the publisher)
+
+These IP address are defined with the `PSA_IP` property, 
+with the definition multicast ip address at (ethernet) interface ip address
+For example: `PSA_IP=224.100.0.0/[email protected]/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used
+by the pubsub admin for searching the network interfaces. 
+The multicast address will use the last digits of the network interface IP 
address 
+for an unique multicast address.   
+
+Note the port will be automatically assigned, when none is specified.
+A fixed port can be assigned for example with: 
`PSA_IP=224.100.0.0/24:[email protected]/24`.
+
+### IP Address Broadcast
+
+To use UDP-broad 2 IP addresses are needed:
+
+1. The broadcast address (X.X.X.255)
+2. IP address which is bound to an (ethernet) interface (from the publisher)
+
+These IP address are defined with the `PSA_IP` property,
+with the definition broadcast ip address at (etnernet) interface ip address
+For example: `[email protected]/24`.

Review comment:
       Is this really still a valid CIDR notation or an custom extension of 
this?

##########
File path: bundles/pubsub/pubsub_utils/src/pubsub_skt_handler.c
##########
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
- * pubsub_tcp_handler.c
+ * pubsub_skt_handler.c

Review comment:
       pubsub has two libs pubsub_utils and pubsub_spi.
   
   Although I think there are not ideally split, the idea is that:
    - pubsub_spi should be used/needed when you want to extend the PSA system 
(new PubSubAdmin or PubSubDiscovery)
    - pubsub_utils should be used/needed when you use the PSA system (Add your 
own interceptor, etc)
   
   So I think the pubsub_skt_handler can go to the pubsub_spi lib. 

##########
File path: bundles/pubsub/examples/CMakeLists.txt
##########
@@ -97,6 +97,86 @@ if (BUILD_PUBSUB_PSA_UDP_MC)
     endif ()
 endif()
 
+if (BUILD_PUBSUB_PSA_UDP)
+    # TCP

Review comment:
       The Comment states TCP

##########
File path: bundles/pubsub/pubsub_admin_tcp/README.md
##########
@@ -0,0 +1,112 @@
+---
+title: PSA TCP 
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# PUBSUB-Admin TCP 
+
+---
+
+## Description
+
+The scope of this description is the TCP PubSub admin. 
+
+The TCP pubsub admin is used to transfer user data transparent via TCP.
+
+### IP Addresses 
+
+To use TCP, 1 IP address is needed:
+This is the IP address that is bound to an (ethernet) interface (from the 
publisher). 
+This IP address is defined with  the `PSA_IP` property.
+For example: `PSA_IP=192.168.1.0/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used
+by the pubsub admin for searching the network interfaces.
+
+Note the port will be automatically assigned, when none is specified.
+A fixed port can be assigned for example with: `PSA_IP=192.168.1.0/24:34000`.
+
+
+### Discovery
+
+When a publisher wants to publish a topic a TopicSender and publisher endpoint 
is created by the Pubsub Topology Manager.
+When a subscriber wants to subscribe to topic a TopicReceiver and subscriber 
endpoint is created by the Pubsub Topology Manager.
+The endpoints are published by the PubSubDiscovery within its topic in ETCD 
(i.e. udp://192.168.1.20:40123).
+A subscriber, interested in the topic, is informed by the TopologyManager that 
there is a new endpoint. 
+The TopicReceiver at the subscriber side creates a listening socket based on 
this endpoint.
+Now a data-connection is created and data send by the publisher will be 
received by the subscriber.  
+
+### Static endpoint
+
+TCP pubsub admin also be used as a static endpoint that can be used to 
communicate with external
+TCP publish/subsribers that don't use Discovery.
+---
+With the `tcp.static.bind.url` property, the static UDP bind can be 
configured. 
+For TCP the publisher topic properties should configure the 
`udp.static.bind.url` property to configure TCP bind interface
+that accepts incomming connections.
+
+---
+With the `udp.static.connect.urls` property, the static TCP connections can be 
configured. (Note The urls are space separate)

Review comment:
       again `udp.` instead of `tcp.`

##########
File path: bundles/pubsub/pubsub_admin_tcp/README.md
##########
@@ -0,0 +1,112 @@
+---
+title: PSA TCP 

Review comment:
       This readme contains more info than only the PSA TCP. Can this be 
promoted to higher level (and maybe add the zmq.static.bind.url, etc config 
options.

##########
File path: bundles/pubsub/pubsub_admin_tcp/README.md
##########
@@ -0,0 +1,112 @@
+---
+title: PSA TCP 
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# PUBSUB-Admin TCP 
+
+---
+
+## Description
+
+The scope of this description is the TCP PubSub admin. 
+
+The TCP pubsub admin is used to transfer user data transparent via TCP.
+
+### IP Addresses 
+
+To use TCP, 1 IP address is needed:
+This is the IP address that is bound to an (ethernet) interface (from the 
publisher). 
+This IP address is defined with  the `PSA_IP` property.
+For example: `PSA_IP=192.168.1.0/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used

Review comment:
       nice to see this more clearly documented 👍 

##########
File path: bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_admin.c
##########
@@ -486,15 +486,18 @@ celix_status_t pubsub_tcpAdmin_setupTopicReceiver(void 
*handle, const char *scop
     celixThreadMutex_unlock(&psa->protocols.mutex);
 
     if (receiver != NULL && newEndpoint != NULL) {
-        celixThreadMutex_lock(&psa->discoveredEndpoints.mutex);
-        hash_map_iterator_t iter = 
hashMapIterator_construct(psa->discoveredEndpoints.map);
-        while (hashMapIterator_hasNext(&iter)) {
-            celix_properties_t *endpoint = hashMapIterator_nextValue(&iter);
-            if (pubsub_tcpAdmin_endpointIsPublisher(endpoint) && 
pubsubEndpoint_matchWithTopicAndScope(endpoint, topic, scope)) {
-                pubsub_tcpAdmin_connectEndpointToReceiver(psa, receiver, 
endpoint);
-            }
+        if (pubsub_tcpAdmin_endpointIsPublisher(newEndpoint) && 
pubsubEndpoint_matchWithTopicAndScope(newEndpoint, topic, scope)) {
+            pubsub_tcpAdmin_connectEndpointToReceiver(psa, receiver, 
newEndpoint);
         }
-        celixThreadMutex_unlock(&psa->discoveredEndpoints.mutex);
+        //celixThreadMutex_lock(&psa->discoveredEndpoints.mutex);

Review comment:
       remove commented out code

##########
File path: bundles/pubsub/pubsub_admin_tcp/README.md
##########
@@ -0,0 +1,112 @@
+---
+title: PSA TCP 
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# PUBSUB-Admin TCP 
+
+---
+
+## Description
+
+The scope of this description is the TCP PubSub admin. 
+
+The TCP pubsub admin is used to transfer user data transparent via TCP.
+
+### IP Addresses 
+
+To use TCP, 1 IP address is needed:
+This is the IP address that is bound to an (ethernet) interface (from the 
publisher). 
+This IP address is defined with  the `PSA_IP` property.
+For example: `PSA_IP=192.168.1.0/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used
+by the pubsub admin for searching the network interfaces.
+
+Note the port will be automatically assigned, when none is specified.
+A fixed port can be assigned for example with: `PSA_IP=192.168.1.0/24:34000`.
+
+
+### Discovery
+
+When a publisher wants to publish a topic a TopicSender and publisher endpoint 
is created by the Pubsub Topology Manager.
+When a subscriber wants to subscribe to topic a TopicReceiver and subscriber 
endpoint is created by the Pubsub Topology Manager.
+The endpoints are published by the PubSubDiscovery within its topic in ETCD 
(i.e. udp://192.168.1.20:40123).
+A subscriber, interested in the topic, is informed by the TopologyManager that 
there is a new endpoint. 
+The TopicReceiver at the subscriber side creates a listening socket based on 
this endpoint.
+Now a data-connection is created and data send by the publisher will be 
received by the subscriber.  
+
+### Static endpoint
+
+TCP pubsub admin also be used as a static endpoint that can be used to 
communicate with external
+TCP publish/subsribers that don't use Discovery.
+---
+With the `tcp.static.bind.url` property, the static UDP bind can be 
configured. 
+For TCP the publisher topic properties should configure the 
`udp.static.bind.url` property to configure TCP bind interface

Review comment:
       Replace `udp.static.bind.url` with `tcp.static.bind.url`

##########
File path: bundles/pubsub/pubsub_admin_udp/README.md
##########
@@ -0,0 +1,149 @@
+---
+title: PSA UDP 
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+   
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# PUBSUB-Admin UDP 
+
+---
+
+## Description
+
+The scope of this description is the UDP PubSub admin. 
+
+The UDP pubsub admin is used to transfer user data transparent via UDP 
unicast, UDP broadcast and UDP multicast.
+UDP support packets with a maximum of 64kB . To overcome this limit the admin 
uses a protocol service on top of UDP 
+which fragments the data to be send and these fragments are reassembled at the 
reception side.
+
+### IP Addresses Unicast
+
+To use UDP-unicast, 1 IP address is needed:
+This is the IP address that is bound to an (ethernet) interface (from the 
subscriber). 
+This IP address is defined with  the `PSA_IP` property.
+For example: `PSA_IP=192.168.1.0/24`.
+Note the example uses CIDR notation, the CIDR notation specifies the IP range 
that is used
+by the pubsub admin for searching the network interfaces.
+
+Note the port will be automatically assigned, when none is specified.
+A fixed port can be assigned for example with: `PSA_IP=192.168.1.0/24:34000`.
+
+### IP Address Mulicast
+
+To use UDP-multicast 2 IP addresses are needed:
+
+1. The multicast address (in the range 224.X.X.X - 239.X.X.X)
+2. IP address which is bound to an (ethernet) interface (from the publisher)
+
+These IP address are defined with the `PSA_IP` property, 
+with the definition multicast ip address at (ethernet) interface ip address
+For example: `PSA_IP=224.100.0.0/[email protected]/24`.

Review comment:
       I am not sure If it wise to reuse the `PSA_IP` when using multicast or 
broadcast. 
   
   Because in that case the `PSA_IP` is not valid anymore for PSA_TCP, PSA_ZMQ, 
etc. 
   
   Maybe it is a idea to always support:
   1. first look for a PSA type specific PSA_IP config property:
   <PSA_TYPE>_PSA_IP , e.g. UDP_PSA_IP, TCP_PSA_IP or ZMQ_PSA_IP
   2. fallback to PSA_IP If not PSA type specific variant is configured:
   PSA_IP
   3. fallback to the first Ethernet interface
   

##########
File path: bundles/pubsub/pubsub_utils/src/pubsub_skt_handler.c
##########
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
- * pubsub_tcp_handler.c
+ * pubsub_skt_handler.c

Review comment:
       Very nice to see that the socket concept can be shared between multiple 
PSA implementations. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to