@@ -42,113 +42,113 @@ public static async Task RunAsync()
42
42
} ;
43
43
44
44
// mqtt.eclipseprojects.io
45
- await ExecuteTestAsync (
45
+ await ExecuteTestsAsync (
46
46
"mqtt.eclipseprojects.io TCP" ,
47
47
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "mqtt.eclipseprojects.io" , 1883 ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
48
48
49
- await ExecuteTestAsync (
49
+ await ExecuteTestsAsync (
50
50
"mqtt.eclipseprojects.io WS" ,
51
51
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "mqtt.eclipseprojects.io:80/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
52
52
53
53
#if NET5_0_OR_GREATER
54
- await ExecuteTestAsync ( "mqtt.eclipseprojects.io WS TLS13" ,
54
+ await ExecuteTestsAsync ( "mqtt.eclipseprojects.io WS TLS13" ,
55
55
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "mqtt.eclipseprojects.io:443/mqtt" ) )
56
56
. WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls13 ) . Build ( ) ) ;
57
57
58
- await ExecuteTestAsync ( "mqtt.eclipseprojects.io WS TLS13 (WebSocket4Net)" ,
58
+ await ExecuteTestsAsync ( "mqtt.eclipseprojects.io WS TLS13 (WebSocket4Net)" ,
59
59
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "mqtt.eclipseprojects.io:443/mqtt" ) )
60
60
. WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls13 ) . Build ( ) ,
61
61
true ) ;
62
62
#endif
63
63
64
64
// test.mosquitto.org
65
- await ExecuteTestAsync (
65
+ await ExecuteTestsAsync (
66
66
"test.mosquitto.org TCP" ,
67
67
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "test.mosquitto.org" , 1883 ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
68
68
69
- await ExecuteTestAsync (
69
+ await ExecuteTestsAsync (
70
70
"test.mosquitto.org TCP - Authenticated" ,
71
71
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "test.mosquitto.org" , 1884 ) . WithCredentials ( "rw" , "readwrite" ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
72
72
73
- await ExecuteTestAsync (
73
+ await ExecuteTestsAsync (
74
74
"test.mosquitto.org TCP TLS12" ,
75
75
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "test.mosquitto.org" , 8883 ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls12 ) . Build ( ) ) ;
76
76
77
77
#if NET5_0_OR_GREATER
78
- await ExecuteTestAsync ( "test.mosquitto.org TCP TLS13" ,
78
+ await ExecuteTestsAsync ( "test.mosquitto.org TCP TLS13" ,
79
79
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "test.mosquitto.org" , 8883 )
80
80
. WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls13 ) . Build ( ) ) ;
81
81
#endif
82
82
83
- await ExecuteTestAsync (
83
+ await ExecuteTestsAsync (
84
84
"test.mosquitto.org TCP TLS12 - Authenticated" ,
85
85
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "test.mosquitto.org" , 8885 )
86
86
. WithCredentials ( "rw" , "readwrite" )
87
87
. WithProtocolVersion ( MqttProtocolVersion . V311 )
88
88
. WithTlsOptions ( unsafeTls12 )
89
89
. Build ( ) ) ;
90
90
91
- await ExecuteTestAsync (
91
+ await ExecuteTestsAsync (
92
92
"test.mosquitto.org WS" ,
93
93
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "test.mosquitto.org:8080/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
94
94
95
- await ExecuteTestAsync (
95
+ await ExecuteTestsAsync (
96
96
"test.mosquitto.org WS (WebSocket4Net)" ,
97
97
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "test.mosquitto.org:8080/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ,
98
98
true ) ;
99
99
100
- await ExecuteTestAsync (
100
+ await ExecuteTestsAsync (
101
101
"test.mosquitto.org WS TLS12" ,
102
102
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "test.mosquitto.org:8081/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls12 ) . Build ( ) ) ;
103
103
104
- await ExecuteTestAsync (
104
+ await ExecuteTestsAsync (
105
105
"test.mosquitto.org WS TLS12 (WebSocket4Net)" ,
106
106
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "test.mosquitto.org:8081/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls12 ) . Build ( ) ,
107
107
true ) ;
108
108
109
109
// broker.emqx.io
110
- await ExecuteTestAsync (
110
+ await ExecuteTestsAsync (
111
111
"broker.emqx.io TCP" ,
112
112
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "broker.emqx.io" , 1883 ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
113
113
114
- await ExecuteTestAsync (
114
+ await ExecuteTestsAsync (
115
115
"broker.emqx.io TCP TLS12" ,
116
116
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "broker.emqx.io" , 8883 ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls12 ) . Build ( ) ) ;
117
117
118
118
#if NET5_0_OR_GREATER
119
- await ExecuteTestAsync ( "broker.emqx.io TCP TLS13" ,
119
+ await ExecuteTestsAsync ( "broker.emqx.io TCP TLS13" ,
120
120
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "broker.emqx.io" , 8883 )
121
121
. WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls13 ) . Build ( ) ) ;
122
122
#endif
123
123
124
- await ExecuteTestAsync (
124
+ await ExecuteTestsAsync (
125
125
"broker.emqx.io WS" ,
126
126
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "broker.emqx.io:8083/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
127
127
128
- await ExecuteTestAsync (
128
+ await ExecuteTestsAsync (
129
129
"broker.emqx.io WS (WebSocket4Net)" ,
130
130
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "broker.emqx.io:8084/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ,
131
131
true ) ;
132
132
133
- await ExecuteTestAsync (
133
+ await ExecuteTestsAsync (
134
134
"broker.emqx.io WS TLS12" ,
135
135
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "broker.emqx.io:8084/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls12 ) . Build ( ) ) ;
136
136
137
- await ExecuteTestAsync (
137
+ await ExecuteTestsAsync (
138
138
"broker.emqx.io WS TLS12 (WebSocket4Net)" ,
139
139
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "broker.emqx.io:8084/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . WithTlsOptions ( unsafeTls12 ) . Build ( ) ,
140
140
true ) ;
141
141
142
142
// broker.hivemq.com
143
- await ExecuteTestAsync (
143
+ await ExecuteTestsAsync (
144
144
"broker.hivemq.com TCP" ,
145
145
new MqttClientOptionsBuilder ( ) . WithTcpServer ( "broker.hivemq.com" , 1883 ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
146
146
147
- await ExecuteTestAsync (
147
+ await ExecuteTestsAsync (
148
148
"broker.hivemq.com WS" ,
149
149
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "broker.hivemq.com:8000/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ) ;
150
150
151
- await ExecuteTestAsync (
151
+ await ExecuteTestsAsync (
152
152
"broker.hivemq.com WS (WebSocket4Net)" ,
153
153
new MqttClientOptionsBuilder ( ) . WithWebSocketServer ( o => o . WithUri ( "broker.hivemq.com:8000/mqtt" ) ) . WithProtocolVersion ( MqttProtocolVersion . V311 ) . Build ( ) ,
154
154
true ) ;
@@ -160,6 +160,15 @@ await ExecuteTestAsync(
160
160
Console . ReadLine ( ) ;
161
161
}
162
162
163
+ static async Task ExecuteTestsAsync ( string name , MqttClientOptions options , bool useWebSocket4Net = false )
164
+ {
165
+ options . ProtocolVersion = MqttProtocolVersion . V311 ;
166
+ await ExecuteTestAsync ( name + " V3.1.1" , options , useWebSocket4Net ) ;
167
+
168
+ options . ProtocolVersion = MqttProtocolVersion . V500 ;
169
+ await ExecuteTestAsync ( name + " V5.0.0" , options , useWebSocket4Net ) ;
170
+ }
171
+
163
172
static async Task ExecuteTestAsync ( string name , MqttClientOptions options , bool useWebSocket4Net = false )
164
173
{
165
174
try
0 commit comments