@@ -25,7 +25,8 @@ internal class Arguments{
2525 new ( "config" , "Konfigurationsname" , Argument . ArgumentType . String , "default" ) ,
2626 new ( "interactive" , "Alle Argumente müssen vom Benutzer eingegeben werden" , Argument . ArgumentType . Bool , false ) ,
2727 new ( "no-resume" , "Vorhandene Dateien werden immer komplett neu übertragen" , Argument . ArgumentType . Bool , false ) ,
28- new ( "device-timeout" , "Timeout in dem das Gerät eine Antwort schicken muss" , Argument . ArgumentType . Int , 4000 )
28+ new ( "device-timeout" , "Timeout in dem das Gerät eine Antwort schicken muss" , Argument . ArgumentType . Int , 4000 ) ,
29+ new ( "tcp" , "Verwende TCP als Transportprotokoll" , Argument . ArgumentType . Bool , false )
2930 } ;
3031
3132 public UnicastAddress ? PhysicalAddress { get ; private set ; } = null ;
@@ -130,6 +131,7 @@ public async Task Init(string[] args, bool isOpen = false)
130131 Console . ForegroundColor = ConsoleColor . DarkGray ;
131132 Console . WriteLine ( $ "Verwende als source address { Get < string > ( "gs" ) } ") ;
132133 Console . ResetColor ( ) ;
134+ Set ( "tcp" , "false" ) ;
133135 }
134136
135137 SaveArgs ( configName ) ;
@@ -181,7 +183,7 @@ private async Task<bool> SearchGateways(bool isAuto = false)
181183 if ( svcFamilies . GetServiceFamilyVersion ( Kaenx . Konnect . Enums . ServiceFamilies . Tunneling ) > 0 )
182184 {
183185 int tunnelingVersion = svcFamilies . GetServiceFamilyVersion ( Kaenx . Konnect . Enums . ServiceFamilies . Tunneling ) ;
184- Console . WriteLine ( $ "{ counter , 2 } Tunneling v{ tunnelingVersion } -> { hpai . Endpoint , - 20 } ({ deviceInfo . UnicastAddress , - 9 } ) [{ deviceInfo . FriendlyName } ]") ;
186+ Console . WriteLine ( $ "{ counter , 2 } Tunneling v{ tunnelingVersion } [UDP] -> { hpai . Endpoint , - 20 } ({ deviceInfo . UnicastAddress , - 9 } ) [{ deviceInfo . FriendlyName } ]") ;
185187 Connection conn = new ( hpai . Endpoint )
186188 {
187189 FriendlyName = deviceInfo . FriendlyName ,
@@ -190,12 +192,26 @@ private async Task<bool> SearchGateways(bool isAuto = false)
190192 } ;
191193 gateways . Add ( conn ) ;
192194 counter ++ ;
195+
196+ if ( tunnelingVersion >= 2 )
197+ {
198+ Console . WriteLine ( $ "{ counter , 2 } Tunneling v{ tunnelingVersion } [TCP] -> { hpai . Endpoint , - 20 } ({ deviceInfo . UnicastAddress , - 9 } ) [{ deviceInfo . FriendlyName } ]") ;
199+ Connection tcpConn = new ( hpai . Endpoint )
200+ {
201+ IsTCP = true ,
202+ FriendlyName = deviceInfo . FriendlyName ,
203+ PhysicalAddress = deviceInfo . UnicastAddress ,
204+ Version = tunnelingVersion
205+ } ;
206+ gateways . Add ( tcpConn ) ;
207+ counter ++ ;
208+ }
193209 }
194210
195211 if ( svcFamilies . GetServiceFamilyVersion ( Kaenx . Konnect . Enums . ServiceFamilies . Routing ) > 0 )
196212 {
197213 int routingVersion = svcFamilies . GetServiceFamilyVersion ( Kaenx . Konnect . Enums . ServiceFamilies . Routing ) ;
198- Console . WriteLine ( $ "{ counter , 2 } Routing v{ routingVersion } -> { hpai . Endpoint , - 20 } ({ deviceInfo . UnicastAddress , - 9 } ) [{ deviceInfo . FriendlyName } ]") ;
214+ Console . WriteLine ( $ "{ counter , 2 } Routing v{ routingVersion } [UDP] -> { hpai . Endpoint , - 20 } ({ deviceInfo . UnicastAddress , - 9 } ) [{ deviceInfo . FriendlyName } ]") ;
199215 Connection conn = new ( hpai . Endpoint )
200216 {
201217 IsRouting = true ,
@@ -235,6 +251,7 @@ private async Task<bool> SearchGateways(bool isAuto = false)
235251 Set ( "gw" , conn . IPAddress . Address . ToString ( ) ) ;
236252 Set ( "ga" , conn . PhysicalAddress . ToString ( ) ) ;
237253 Set ( "port" , conn . IPAddress . Port . ToString ( ) ) ;
254+ Set ( "tcp" , conn . IsTCP . ToString ( ) ) ;
238255 IsRouting = conn . IsRouting ;
239256 }
240257 }
@@ -259,6 +276,7 @@ private async Task<bool> SearchGateways(bool isAuto = false)
259276 Set ( "gw" , conn . IPAddress . Address . ToString ( ) ) ;
260277 Set ( "ga" , conn . PhysicalAddress . ToString ( ) ) ;
261278 Set ( "port" , conn . IPAddress . Port . ToString ( ) ) ;
279+ Set ( "tcp" , conn . IsTCP . ToString ( ) ) ;
262280 IsRouting = conn . IsRouting ;
263281 }
264282 return true ;
0 commit comments