Skip to content

Commit 048d6ff

Browse files
committed
fixes broken project files for vs2005
1 parent 52f1e6e commit 048d6ff

File tree

4 files changed

+103
-45
lines changed

4 files changed

+103
-45
lines changed

CoAP.NET/CoAP.NET.2005.csproj

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,49 @@
2828
<WarningLevel>4</WarningLevel>
2929
<DocumentationFile>bin\Release\CoAP.NET.XML</DocumentationFile>
3030
</PropertyGroup>
31+
<PropertyGroup>
32+
<SignAssembly>true</SignAssembly>
33+
</PropertyGroup>
34+
<PropertyGroup>
35+
<AssemblyOriginatorKeyFile>coapnet.snk</AssemblyOriginatorKeyFile>
36+
</PropertyGroup>
3137
<ItemGroup>
3238
<Reference Include="System" />
39+
<Reference Include="System.Runtime.Remoting" />
3340
</ItemGroup>
3441
<ItemGroup>
3542
<Compile Include="BlockOption.cs" />
43+
<Compile Include="CoapConfig.cs" />
3644
<Compile Include="CoapConstants.cs" />
3745
<Compile Include="Code.cs" />
3846
<Compile Include="Communicator.cs" />
3947
<Compile Include="EndpointAddress.cs" />
40-
<Compile Include="EndPoint\Resources\DiscoveryResource.cs" />
4148
<Compile Include="EndPoint\EndPoint.cs" />
4249
<Compile Include="EndPoint\LocalEndPoint.cs" />
50+
<Compile Include="EndPoint\ProxyEndpoint.cs" />
51+
<Compile Include="EndPoint\Resources\DiscoveryResource.cs" />
52+
<Compile Include="EndPoint\Resources\ForwardingResource.cs" />
4353
<Compile Include="EndPoint\Resources\LocalResource.cs" />
54+
<Compile Include="EndPoint\Resources\ProxyCoapClientResource.cs" />
55+
<Compile Include="EndPoint\Resources\ProxyHttpClientResource.cs" />
4456
<Compile Include="EndPoint\Resources\RemoteResource.cs" />
4557
<Compile Include="EndPoint\Resources\Resource.cs" />
4658
<Compile Include="EndPoint\Resources\TimerResource.cs" />
59+
<Compile Include="EndPoint\ThreadPoolDispatcher.cs" />
60+
<Compile Include="Http\IHttpRequest.cs" />
61+
<Compile Include="Http\IHttpResponse.cs" />
62+
<Compile Include="Http\IServiceProvider.cs" />
63+
<Compile Include="Http\RemotingHttpRequest.cs" />
64+
<Compile Include="Http\WebServer.cs" />
65+
<Compile Include="ICoapConfig.cs" />
4766
<Compile Include="IMessageHandler.cs" />
4867
<Compile Include="IRequestHandler.cs" />
4968
<Compile Include="IMessageReceiver.cs" />
5069
<Compile Include="IShutdown.cs" />
5170
<Compile Include="Layers\AbstractLayer.cs" />
5271
<Compile Include="Layers\AdverseLayer.cs" />
5372
<Compile Include="Layers\CoapStack.cs" />
73+
<Compile Include="Layers\HttpStack.cs" />
5474
<Compile Include="Layers\ILayer.cs" />
5575
<Compile Include="Layers\MatchingLayer.cs" />
5676
<Compile Include="Layers\MessageLayer.cs" />
@@ -73,16 +93,22 @@
7393
<Compile Include="Response.cs" />
7494
<Compile Include="ResponseEventArgs.cs" />
7595
<Compile Include="Spec.cs" />
96+
<Compile Include="Util\ArrayEqualityComparer.cs" />
97+
<Compile Include="Util\ThrowHelper.cs" />
7698
<Compile Include="TokenManager.cs" />
7799
<Compile Include="Util\ByteArrayUtils.cs" />
100+
<Compile Include="Util\CoapTranslator.cs" />
78101
<Compile Include="Util\DatagramReader.cs" />
79102
<Compile Include="Util\DatagramWriter.cs" />
80103
<Compile Include="Util\HashMap.cs" />
81104
<Compile Include="Util\HashSet.cs" />
105+
<Compile Include="Util\HttpTranslator.cs" />
82106
<Compile Include="Util\Scanner.cs" />
83107
<Compile Include="Util\Sort.cs" />
108+
<Compile Include="Util\TranslationException.cs" />
84109
</ItemGroup>
85110
<ItemGroup>
111+
<None Include="coapnet.snk" />
86112
<None Include="README" />
87113
</ItemGroup>
88114
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

CoAP.NET/Http/RemotingHttpRequest.cs

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,33 @@ class RemotingHttpRequest : IHttpRequest
2424
private IDictionary<String, Object> _parameters;
2525
private IDictionary<Object, Object> _data;
2626
private NameValueCollection _headers = new NameValueCollection();
27+
private String _url;
28+
private String _requestUri;
29+
private String _queryString;
30+
private String _method;
31+
private Stream _inputStream;
32+
private String _host;
33+
private String _userAgent;
2734

2835
public RemotingHttpRequest(ITransportHeaders headers, Stream stream)
2936
{
30-
Method = (String)headers["__RequestVerb"];
31-
Host = (String)headers["Host"];
32-
UserAgent = (String)headers["User-Agent"];
37+
_method = (String)headers["__RequestVerb"];
38+
_host = (String)headers["Host"];
39+
_userAgent = (String)headers["User-Agent"];
3340

3441
String requestUri = (String)headers["__RequestUri"];
35-
Url = "http://" + Host + requestUri;
42+
_url = "http://" + Host + requestUri;
3643

3744
Int32 offset = requestUri.IndexOf('?');
3845
if (offset >= 0)
3946
{
40-
RequestUri = requestUri.Substring(0, offset);
41-
QueryString = requestUri.Substring(offset + 1);
47+
_requestUri = requestUri.Substring(0, offset);
48+
_queryString = requestUri.Substring(offset + 1);
4249
}
4350
else
4451
{
45-
RequestUri = requestUri;
46-
QueryString = null;
52+
_requestUri = requestUri;
53+
_queryString = null;
4754
}
4855

4956
foreach (DictionaryEntry item in headers)
@@ -52,27 +59,48 @@ public RemotingHttpRequest(ITransportHeaders headers, Stream stream)
5259
_headers.Add((String)item.Key, (String)item.Value);
5360
}
5461

55-
InputStream = stream;
62+
_inputStream = stream;
5663
}
5764

58-
public String Url { get; set; }
65+
public String Url
66+
{
67+
get { return _url; }
68+
}
5969

60-
public String RequestUri { get; set; }
70+
public String RequestUri
71+
{
72+
get { return _requestUri; }
73+
}
6174

62-
public String QueryString { get; set; }
75+
public String QueryString
76+
{
77+
get { return _queryString; }
78+
}
6379

64-
public String Method { get; set; }
80+
public String Method
81+
{
82+
get { return _method; }
83+
}
6584

6685
public NameValueCollection Headers
6786
{
6887
get { return _headers; }
6988
}
7089

71-
public Stream InputStream { get; set; }
90+
public Stream InputStream
91+
{
92+
get { return _inputStream; }
93+
}
7294

73-
public String Host { get; set; }
95+
public String Host
96+
{
97+
get { return _host; }
98+
}
7499

75-
public String UserAgent { get; set; }
100+
public String UserAgent
101+
{
102+
get { return _userAgent; }
103+
}
76104

77105
public String CharacterEncoding
78106
{

CoAP.NET/Http/WebServer.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,18 @@ public void GetChannelData(IChannelDataStore channelData)
8181
class WebServerChannelSink : IServerChannelSink
8282
{
8383
private readonly WebServer _webServer;
84+
private readonly IServerChannelSink _nextChannelSink;
8485

8586
public WebServerChannelSink(IServerChannelSink next, IChannelReceiver channel, WebServer webServer)
8687
{
8788
_webServer = webServer;
88-
NextChannelSink = next;
89+
_nextChannelSink = next;
8990
}
9091

91-
public IServerChannelSink NextChannelSink { get; private set; }
92+
public IServerChannelSink NextChannelSink
93+
{
94+
get { return _nextChannelSink; }
95+
}
9296

9397
public IDictionary Properties
9498
{
@@ -116,7 +120,7 @@ public ServerProcessing ProcessMessage(IServerChannelSinkStack sinkStack, IMessa
116120
IHttpRequest request = GetRequest(requestHeaders, requestStream);
117121
IHttpResponse response = GetResponse(request);
118122

119-
foreach (var provider in _webServer._serviceProviders)
123+
foreach (IServiceProvider provider in _webServer._serviceProviders)
120124
{
121125
if (provider.Accept(request))
122126
{

CoAP.NET/Util/HashSet.cs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ public HashSet(IEnumerable<T> collection, IEqualityComparer<T> comparer)
111111
throw new ArgumentNullException("collection");
112112

113113
int capacity = 0;
114-
var col = collection as ICollection<T>;
114+
ICollection<T> col = collection as ICollection<T>;
115115
if (col != null)
116116
capacity = col.Count;
117117

118118
Init(capacity, comparer);
119-
foreach (var item in collection)
119+
foreach (T item in collection)
120120
Add(item);
121121
}
122122

@@ -204,8 +204,8 @@ void Resize()
204204
int newSize = HashPrimeNumbers.ToPrime((table.Length << 1) | 1);
205205

206206
// allocate new hash table and link slots array
207-
var newTable = new int[newSize];
208-
var newLinks = new Link[newSize];
207+
Int32[] newTable = new int[newSize];
208+
Link[] newLinks = new Link[newSize];
209209

210210
for (int i = 0; i < table.Length; i++)
211211
{
@@ -224,7 +224,7 @@ void Resize()
224224
links = newLinks;
225225

226226
// allocate new data slots, copy data
227-
var newSlots = new T[newSize];
227+
T[] newSlots = new T[newSize];
228228
Array.Copy(slots, 0, newSlots, 0, touched);
229229
slots = newSlots;
230230

@@ -362,13 +362,13 @@ public int RemoveWhere(Predicate<T> match)
362362
if (match == null)
363363
throw new ArgumentNullException("match");
364364

365-
var candidates = new List<T>();
365+
List<T> candidates = new List<T>();
366366

367-
foreach (var item in this)
367+
foreach (T item in this)
368368
if (match(item))
369369
candidates.Add(item);
370370

371-
foreach (var item in candidates)
371+
foreach (T item in candidates)
372372
Remove(item);
373373

374374
return candidates.Count;
@@ -386,17 +386,17 @@ public void IntersectWith(IEnumerable<T> other)
386386
if (other == null)
387387
throw new ArgumentNullException("other");
388388

389-
var other_set = ToSet(other);
389+
HashSet<T> other_set = ToSet(other);
390390

391-
RemoveWhere(item => !other_set.Contains(item));
391+
RemoveWhere(delegate(T item) { return !other_set.Contains(item); });
392392
}
393393

394394
public void ExceptWith(IEnumerable<T> other)
395395
{
396396
if (other == null)
397397
throw new ArgumentNullException("other");
398398

399-
foreach (var item in other)
399+
foreach (T item in other)
400400
Remove(item);
401401
}
402402

@@ -405,7 +405,7 @@ public bool Overlaps(IEnumerable<T> other)
405405
if (other == null)
406406
throw new ArgumentNullException("other");
407407

408-
foreach (var item in other)
408+
foreach (T item in other)
409409
if (Contains(item))
410410
return true;
411411

@@ -417,12 +417,12 @@ public bool SetEquals(IEnumerable<T> other)
417417
if (other == null)
418418
throw new ArgumentNullException("other");
419419

420-
var other_set = ToSet(other);
420+
HashSet<T> other_set = ToSet(other);
421421

422422
if (count != other_set.Count)
423423
return false;
424424

425-
foreach (var item in this)
425+
foreach (T item in this)
426426
if (!other_set.Contains(item))
427427
return false;
428428

@@ -434,14 +434,14 @@ public void SymmetricExceptWith(IEnumerable<T> other)
434434
if (other == null)
435435
throw new ArgumentNullException("other");
436436

437-
foreach (var item in ToSet(other))
437+
foreach (T item in ToSet(other))
438438
if (!Add(item))
439439
Remove(item);
440440
}
441441

442442
HashSet<T> ToSet(IEnumerable<T> enumerable)
443443
{
444-
var set = enumerable as HashSet<T>;
444+
HashSet<T> set = enumerable as HashSet<T>;
445445
if (set == null || !Comparer.Equals(set.Comparer))
446446
set = new HashSet<T>(enumerable, Comparer);
447447

@@ -453,7 +453,7 @@ public void UnionWith(IEnumerable<T> other)
453453
if (other == null)
454454
throw new ArgumentNullException("other");
455455

456-
foreach (var item in other)
456+
foreach (T item in other)
457457
Add(item);
458458
}
459459

@@ -462,7 +462,7 @@ bool CheckIsSubsetOf(HashSet<T> other)
462462
if (other == null)
463463
throw new ArgumentNullException("other");
464464

465-
foreach (var item in this)
465+
foreach (T item in this)
466466
if (!other.Contains(item))
467467
return false;
468468

@@ -477,7 +477,7 @@ public bool IsSubsetOf(IEnumerable<T> other)
477477
if (count == 0)
478478
return true;
479479

480-
var other_set = ToSet(other);
480+
HashSet<T> other_set = ToSet(other);
481481

482482
if (count > other_set.Count)
483483
return false;
@@ -493,7 +493,7 @@ public bool IsProperSubsetOf(IEnumerable<T> other)
493493
if (count == 0)
494494
return true;
495495

496-
var other_set = ToSet(other);
496+
HashSet<T> other_set = ToSet(other);
497497

498498
if (count >= other_set.Count)
499499
return false;
@@ -506,7 +506,7 @@ bool CheckIsSupersetOf(HashSet<T> other)
506506
if (other == null)
507507
throw new ArgumentNullException("other");
508508

509-
foreach (var item in other)
509+
foreach (T item in other)
510510
if (!Contains(item))
511511
return false;
512512

@@ -518,7 +518,7 @@ public bool IsSupersetOf(IEnumerable<T> other)
518518
if (other == null)
519519
throw new ArgumentNullException("other");
520520

521-
var other_set = ToSet(other);
521+
HashSet<T> other_set = ToSet(other);
522522

523523
if (count < other_set.Count)
524524
return false;
@@ -531,7 +531,7 @@ public bool IsProperSupersetOf(IEnumerable<T> other)
531531
if (other == null)
532532
throw new ArgumentNullException("other");
533533

534-
var other_set = ToSet(other);
534+
HashSet<T> other_set = ToSet(other);
535535

536536
if (count <= other_set.Count)
537537
return false;
@@ -705,7 +705,7 @@ public bool Equals(HashSet<T> lhs, HashSet<T> rhs)
705705
if (lhs == null || rhs == null || lhs.Count != rhs.Count)
706706
return false;
707707

708-
foreach (var item in lhs)
708+
foreach (T item in lhs)
709709
if (!rhs.Contains(item))
710710
return false;
711711

@@ -719,7 +719,7 @@ public int GetHashCode(HashSet<T> hashset)
719719

720720
IEqualityComparer<T> comparer = EqualityComparer<T>.Default;
721721
int hash = 0;
722-
foreach (var item in hashset)
722+
foreach (T item in hashset)
723723
hash ^= comparer.GetHashCode(item);
724724

725725
return hash;

0 commit comments

Comments
 (0)