Skip to content

Commit 3ea40d1

Browse files
committed
Get WinRT project compiling again
1 parent 0e8f664 commit 3ea40d1

File tree

10 files changed

+31
-485
lines changed

10 files changed

+31
-485
lines changed

projects/client/RabbitMQ.Client.WinRT/RabbitMQ.Client.WinRT.csproj

Lines changed: 5 additions & 417 deletions
Large diffs are not rendered by default.

projects/client/RabbitMQ.Client.WinRT/src/client/impl/SocketFrameHandler.cs renamed to projects/client/RabbitMQ.Client.WinRT/src/client/impl/SocketFrameHandlerWinRT.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
// Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
3939
//---------------------------------------------------------------------------
4040

41+
#if NETFX_CORE
4142
using RabbitMQ.Client.Exceptions;
4243
using RabbitMQ.Util;
4344
using System;
@@ -268,3 +269,4 @@ private void Connect(StreamSocket socket, AmqpTcpEndpoint endpoint, int timeout)
268269
}
269270
}
270271
}
272+
#endif

projects/client/RabbitMQ.Client.WinRT/src/client/properties/AssemblyInfo.cs

Lines changed: 0 additions & 55 deletions
This file was deleted.

projects/client/RabbitMQ.Client/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"System.Net.Security": "4.0.0",
5151
"System.Net.Sockets": "4.1.0",
5252
"System.Reflection.Extensions": "4.0.1",
53+
"System.Reflection.TypeExtensions": "4.1.0",
5354
"System.Runtime.Extensions": "4.1.0",
5455
"System.Text.RegularExpressions": "4.1.0",
5556
"System.Threading": "4.0.11",

projects/client/RabbitMQ.Client/src/client/api/ITcpClient.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
using System;
1+
#if !NETFX_CORE
2+
using System;
23
using System.Threading.Tasks;
34

45
using System.Net.Sockets;
56

67
namespace RabbitMQ.Client
78
{
89
/// <summary>
9-
/// Wrapper interface for standard TCP-client. Provides socket for socket frame handler class.
10+
/// Wrapper interface for standard TCP-client. Provides socket for socket frame handler class.
1011
/// </summary>
1112
/// <remarks>Contains all methods that are currenty in use in rabbitmq client.</remarks>
1213
public interface ITcpClient
@@ -24,3 +25,4 @@ public interface ITcpClient
2425
void Close();
2526
}
2627
}
28+
#endif

projects/client/RabbitMQ.Client/src/client/impl/Connection.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,12 +960,14 @@ public void MaybeStartHeartbeatTimers()
960960
{
961961
if (Heartbeat != 0)
962962
{
963-
_heartbeatWriteTimer = new Timer(HeartbeatWriteTimerCallback, null, 200, m_heartbeatTimeSpan.Milliseconds);
964-
_heartbeatReadTimer = new Timer(HeartbeatReadTimerCallback, null, 200, m_heartbeatTimeSpan.Milliseconds);
965963
#if NETFX_CORE
964+
_heartbeatWriteTimer = new Timer(HeartbeatWriteTimerCallback);
965+
_heartbeatReadTimer = new Timer(HeartbeatReadTimerCallback);
966966
_heartbeatWriteTimer.Change(200, (int)m_heartbeatTimeSpan.TotalMilliseconds);
967967
_heartbeatReadTimer.Change(200, (int)m_heartbeatTimeSpan.TotalMilliseconds);
968968
#else
969+
_heartbeatWriteTimer = new Timer(HeartbeatWriteTimerCallback, null, 200, m_heartbeatTimeSpan.Milliseconds);
970+
_heartbeatReadTimer = new Timer(HeartbeatReadTimerCallback, null, 200, m_heartbeatTimeSpan.Milliseconds);
969971
_heartbeatWriteTimer.Change(TimeSpan.FromMilliseconds(200), m_heartbeatTimeSpan);
970972
_heartbeatReadTimer.Change(TimeSpan.FromMilliseconds(200), m_heartbeatTimeSpan);
971973
#endif

projects/client/RabbitMQ.Client/src/client/impl/SocketFrameHandler.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
// Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
3939
//---------------------------------------------------------------------------
4040

41+
#if !NETFX_CORE
4142
using RabbitMQ.Client.Exceptions;
4243
using RabbitMQ.Util;
4344
using System;
@@ -50,7 +51,7 @@
5051

5152
namespace RabbitMQ.Client.Impl
5253
{
53-
static class TaskExtensions
54+
static class TaskExtensions
5455
{
5556
public static async Task TimeoutAfter(this Task task, int millisecondsTimeout)
5657
{
@@ -157,7 +158,7 @@ public int ReadTimeout
157158
try
158159
{
159160
if (m_socket.Connected)
160-
{
161+
{
161162
m_socket.ReceiveTimeout = value;
162163
}
163164
}
@@ -189,7 +190,7 @@ public void Close()
189190
{
190191
try
191192
{
192-
193+
193194
} catch (ArgumentException)
194195
{
195196
// ignore, we are closing anyway
@@ -287,15 +288,16 @@ private void Connect(ITcpClient socket, AmqpTcpEndpoint endpoint, int timeout)
287288
catch (SocketException e)
288289
{
289290
throw new ConnectFailureException("Connection failed", e);
290-
}
291+
}
291292
catch (NotSupportedException e)
292293
{
293294
throw new ConnectFailureException("Connection failed", e);
294-
}
295+
}
295296
catch (TimeoutException e)
296297
{
297298
throw new ConnectFailureException("Connection failed", e);
298299
}
299300
}
300301
}
301302
}
303+
#endif

projects/client/RabbitMQ.Client/src/client/impl/TcpClientAdapter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
#if !NETFX_CORE
2+
using System;
23
using System.Linq;
34
using System.Net.Sockets;
45
using System.Net;
@@ -72,4 +73,5 @@ public virtual int ReceiveTimeout
7273
}
7374
}
7475
}
75-
}
76+
}
77+
#endif

projects/client/RabbitMQ.Client/src/util/DebugUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public static void DumpProperties(object value, TextWriter writer, int indent)
150150
{
151151
Type t = value.GetType();
152152
writer.WriteLine(t.FullName);
153-
#if !(CORECLR)
153+
#if !(NETFX_CORE)
154154
foreach (PropertyInfo pi in t.GetProperties(BindingFlags.Instance
155155
| BindingFlags.Public
156156
| BindingFlags.DeclaredOnly))

projects/client/Unit/src/unit/TestTcpClientAdapter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
// Copyright (c) 2007-2016 Pivotal Software, Inc. All rights reserved.
3939
//---------------------------------------------------------------------------
4040

41+
#if !NETFX_CORE
4142
using System;
4243
using System.Net.Sockets;
4344
using System.Threading;
@@ -61,4 +62,5 @@ public void ConnectAsyncThrowsArgumentExceptionWhenNoAddressForAddressFamilyCanB
6162
});
6263
}
6364
}
64-
}
65+
}
66+
#endif

0 commit comments

Comments
 (0)