|
7 | 7 | import socket |
8 | 8 | import weakref |
9 | 9 | import copy |
| 10 | +import platform |
10 | 11 | import inspect |
11 | 12 | import warnings |
12 | 13 | import traceback |
@@ -225,6 +226,9 @@ def start_local_server( |
225 | 226 | timed_out = False |
226 | 227 | for _ in range(n_attempts): |
227 | 228 | try: |
| 229 | + # Force LegacyGrpc when on macOS |
| 230 | + if platform.system() == "Darwin": |
| 231 | + config = dpf.core.AvailableServerConfigs.LegacyGrpcServer |
228 | 232 | server_type = ServerFactory.get_server_type_from_config( |
229 | 233 | config, ansys_path, docker_config |
230 | 234 | ) |
@@ -309,7 +313,7 @@ def connect_to_server( |
309 | 313 | The default is ``10``. Once the specified number of seconds |
310 | 314 | passes, the connection fails. |
311 | 315 | config: ServerConfig, optional |
312 | | - Manages the type of server connection to use. |
| 316 | + Manages the type of server connection to use. Forced to LegacyGrpc on macOS. |
313 | 317 | context: ServerContext, optional |
314 | 318 | Defines the settings that will be used to load DPF's plugins. |
315 | 319 | A DPF xml file can be used to list the plugins and set up variables. Default is |
@@ -355,6 +359,10 @@ def connect(): |
355 | 359 | dpf.core._server_instances.append(weakref.ref(server)) |
356 | 360 | return server |
357 | 361 |
|
| 362 | + # Enforce LegacyGrpc when on macOS |
| 363 | + if platform.system() == 'Darwin': |
| 364 | + config = dpf.core.AvailableServerConfigs.LegacyGrpcServer |
| 365 | + |
358 | 366 | server_type = ServerFactory.get_remote_server_type_from_config(config) |
359 | 367 | try: |
360 | 368 | return connect() |
|
0 commit comments