|
1 | 1 | @testset "Message dispatcher" begin |
2 | 2 |
|
3 | 3 | if Sys.iswindows() |
4 | | - global_socket_name = "\\\\.\\pipe\\jsonrpc-testrun" |
| 4 | + global_socket_name1 = "\\\\.\\pipe\\jsonrpc-testrun1" |
5 | 5 | elseif Sys.isunix() |
6 | | - global_socket_name = joinpath(tempdir(), "jsonrpc-testrun") |
| 6 | + global_socket_name1 = joinpath(tempdir(), "jsonrpc-testrun1") |
7 | 7 | else |
8 | 8 | error("Unknown operating system.") |
9 | 9 | end |
|
17 | 17 | server_is_up = Base.Condition() |
18 | 18 |
|
19 | 19 | server_task = @async try |
20 | | - server = listen(global_socket_name) |
| 20 | + server = listen(global_socket_name1) |
21 | 21 | notify(server_is_up) |
22 | 22 | sock = accept(server) |
23 | 23 | global conn = JSONRPC.JSONRPCEndpoint(sock, sock) |
|
41 | 41 |
|
42 | 42 | wait(server_is_up) |
43 | 43 |
|
44 | | - sock2 = connect(global_socket_name) |
| 44 | + sock2 = connect(global_socket_name1) |
45 | 45 | conn2 = JSONRPCEndpoint(sock2, sock2) |
46 | 46 |
|
47 | 47 | run(conn2) |
|
63 | 63 |
|
64 | 64 | # Now we test a faulty server |
65 | 65 |
|
| 66 | + if Sys.iswindows() |
| 67 | + global_socket_name2 = "\\\\.\\pipe\\jsonrpc-testrun2" |
| 68 | + elseif Sys.isunix() |
| 69 | + global_socket_name2 = joinpath(tempdir(), "jsonrpc-testrun2") |
| 70 | + else |
| 71 | + error("Unknown operating system.") |
| 72 | + end |
| 73 | + |
66 | 74 | server_is_up = Base.Condition() |
67 | 75 |
|
68 | 76 | server_task2 = @async try |
69 | | - server = listen(global_socket_name) |
| 77 | + server = listen(global_socket_name2) |
70 | 78 | notify(server_is_up) |
71 | 79 | sock = accept(server) |
72 | 80 | global conn = JSONRPC.JSONRPCEndpoint(sock, sock) |
|
85 | 93 |
|
86 | 94 | wait(server_is_up) |
87 | 95 |
|
88 | | - sock2 = connect(global_socket_name) |
| 96 | + sock2 = connect(global_socket_name2) |
89 | 97 | conn2 = JSONRPCEndpoint(sock2, sock2) |
90 | 98 |
|
91 | 99 | run(conn2) |
|
0 commit comments