File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 2
2
using System . Net ;
3
3
using System . Net . Sockets ;
4
4
5
- #if FEATURE_DEVICEINFORMATION_APM
5
+ #if FEATURE_DNS_SYNC
6
+ #elif FEATURE_DNS_APM
7
+ using Renci . SshNet . Common ;
8
+ #elif FEATURE_DNS_TAP
9
+ #elif FEATURE_DEVICEINFORMATION_APM
6
10
using System . Collections . Generic ;
7
11
using System . Linq ;
8
12
using System . Threading ;
9
13
using Microsoft . Phone . Net . NetworkInformation ;
10
- #endif // FEATURE_DEVICEINFORMATION_APM
11
-
12
- #if FEATURE_DATAGRAMSOCKET
14
+ #elif FEATURE_DATAGRAMSOCKET
13
15
using System . Collections . Generic ;
14
16
using Windows . Networking ;
15
17
using Windows . Networking . Sockets ;
16
- #endif // FEATURE_DATAGRAMSOCKET
18
+ #endif
17
19
18
20
namespace Renci . SshNet . Abstractions
19
21
{
@@ -41,7 +43,7 @@ public static IPAddress[] GetHostAddresses(string hostNameOrAddress)
41
43
throw new SshOperationTimeoutException ( "Timeout resolving host name." ) ;
42
44
return Dns . EndGetHostAddresses ( asyncResult ) ;
43
45
#elif FEATURE_DNS_TAP
44
- return Dns . GetHostAddressesAsync ( hostNameOrAddress ) . Result ;
46
+ return Dns . GetHostAddressesAsync ( hostNameOrAddress ) . GetAwaiter ( ) . GetResult ( ) ;
45
47
#else
46
48
IPAddress address ;
47
49
if ( IPAddress . TryParse ( hostNameOrAddress , out address ) )
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static void Sleep(int millisecondsTimeout)
13
13
#if FEATURE_THREAD_SLEEP
14
14
System . Threading . Thread . Sleep ( millisecondsTimeout ) ;
15
15
#elif FEATURE_THREAD_TAP
16
- System . Threading . Tasks . Task . Delay ( millisecondsTimeout ) . Wait ( ) ;
16
+ System . Threading . Tasks . Task . Delay ( millisecondsTimeout ) . GetAwaiter ( ) . GetResult ( ) ;
17
17
#else
18
18
#error Suspend of the current thread is not implemented.
19
19
#endif
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ public void Start()
135
135
136
136
if ( WaitHandle . WaitAny ( new [ ] { readWaitHandle , _channelClosedWaitHandle } ) == 0 )
137
137
{
138
- var read = readTask . Result ;
138
+ var read = readTask . GetAwaiter ( ) . GetResult ( ) ;
139
139
_channel . SendData ( buffer , 0 , read ) ;
140
140
continue ;
141
141
}
You can’t perform that action at this time.
0 commit comments