File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
osu.Framework.Tests/Platform Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,8 @@ public void TestOneWay()
4646 Assert . IsTrue ( server . IsPrimaryInstance , @"Server wasn't able to bind" ) ;
4747 Assert . IsFalse ( client . IsPrimaryInstance , @"Client was able to bind when it shouldn't have been able to" ) ;
4848
49- var serverChannel = new IpcChannel < Foobar , object > ( server ) ;
50- var clientChannel = new IpcChannel < Foobar , object > ( client ) ;
49+ var serverChannel = new IpcChannel < Foobar > ( server ) ;
50+ var clientChannel = new IpcChannel < Foobar > ( client ) ;
5151
5252 async Task waitAction ( )
5353 {
Original file line number Diff line number Diff line change 77namespace osu . Framework . Platform
88{
99 /// <summary>
10- /// Setup an IPC channel which supports sending a specific pair of well-defined types .
10+ /// Define an IPC channel which supports sending a specific well-defined type .
1111 /// </summary>
12- /// <typeparam name="T"></typeparam>
13- /// <typeparam name="TResponse"></typeparam>
12+ /// <typeparam name="T">The type to send.</typeparam>
13+ public class IpcChannel < T > : IpcChannel < T , object > where T : class
14+ {
15+ public IpcChannel ( IIpcHost host )
16+ : base ( host )
17+ {
18+ }
19+ }
20+
21+ /// <summary>
22+ /// Define an IPC channel which supports sending and receiving a specific well-defined type.
23+ /// </summary>
24+ /// <typeparam name="T">The type to send.</typeparam>
25+ /// <typeparam name="TResponse">The type to receive.</typeparam>
1426 public class IpcChannel < T , TResponse > : IDisposable
1527 where T : class
1628 where TResponse : class
1729 {
1830 private readonly IIpcHost host ;
1931
20- public event Func < T , TResponse > ? MessageReceived ;
32+ public event Func < T , TResponse ? > ? MessageReceived ;
2133
2234 public IpcChannel ( IIpcHost host )
2335 {
@@ -37,7 +49,7 @@ public Task SendMessageAsync(T message) => host.SendMessageAsync(new IpcMessage
3749 {
3850 Type = typeof ( T ) . AssemblyQualifiedName ,
3951 Value = message ,
40- } ) ;
52+ } ) . ConfigureAwait ( false ) ;
4153
4254 if ( response == null )
4355 return null ;
You can’t perform that action at this time.
0 commit comments