diff --git a/connections/clients/windows/dart/core_adapter_dart.cc b/connections/clients/windows/dart/core_adapter_dart.cc index 1697071e..95d34424 100644 --- a/connections/clients/windows/dart/core_adapter_dart.cc +++ b/connections/clients/windows/dart/core_adapter_dart.cc @@ -542,6 +542,25 @@ void AcceptConnectionDart(Core *pCore, const char *endpoint_id, finished.Await(); } +void RejectConnectionDart(Core *pCore, const char *endpoint_id, + Dart_Port dart_port) { + if (!pCore) { + PostResult(dart_port, Status::Value::kError); + return; + } + + port = dart_port; + + ResultCallbackW callback; + SetResultCallback(callback, dart_port); + + CountDownLatch finished(1); + adapter_finished = &finished; + + RejectConnection(pCore, endpoint_id, callback); + + finished.Await(); +} void DisconnectFromEndpointDart(Core *pCore, char *endpoint_id, Dart_Port dart_port) { if (!pCore) { diff --git a/connections/clients/windows/dart/core_adapter_dart.h b/connections/clients/windows/dart/core_adapter_dart.h index 084ffb06..71d48b5e 100644 --- a/connections/clients/windows/dart/core_adapter_dart.h +++ b/connections/clients/windows/dart/core_adapter_dart.h @@ -259,6 +259,10 @@ DLL_API void __stdcall AcceptConnectionDart(Core *pCore, PayloadListenerDart listener_dart, Dart_Port result_cb); +DLL_API void __stdcall RejectConnectionDart(Core *pCore, + const char *endpoint_id, + Dart_Port result_cb); + // Disconnects from a remote endpoint. {@link Payload}s can no longer be sent // to or received from the endpoint after this method is called. // endpoint_id - The identifier for the remote endpoint to disconnect from. diff --git a/connections/clients/windows/listeners_w.h b/connections/clients/windows/listeners_w.h index a4696add..64fb04bd 100644 --- a/connections/clients/windows/listeners_w.h +++ b/connections/clients/windows/listeners_w.h @@ -117,7 +117,6 @@ struct DLL_API ConnectionResponseInfoW { struct DLL_API PayloadProgressInfoW { PayloadId payload_id = 0; enum class Status { - kUnspecified = 0, kSuccess, kFailure, kInProgress,