Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.

Commit 93c9a71

Browse files
Update BookUpdates
for WebListener
1 parent 3e377b1 commit 93c9a71

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

BookUpdates.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,26 @@ public static MySafe InitProtection()
188188
}
189189
```
190190

191+
## Chapter 25 - Networking
192+
193+
Page 714, the WebLister changed
194+
195+
The UrlPrefixes need to be added using the Settings property:
196+
197+
```csharp
198+
foreach (var prefix in prefixes)
199+
{
200+
listener.Settings.UrlPrefixes.Add(prefix);
201+
WriteLine($"\t{prefix}");
202+
}
203+
```
204+
205+
Instead of invoking GetContextAsync, invoke AcceptAsync:
206+
207+
```csharp
208+
RequestContext context = await listener.AcceptAsync()
209+
```
210+
191211
## Chapter 27 - XML and JSON
192212

193213
Page 812, the Load method of the XDocument class supports only loading of local files (the .NET Framework version of this method supports loading files from HTTP servers as well). The sample code for the `QueryFeed` method needs to be changed. The HttpClient class is used to make a HTTP GET requests to return a stream. The stream is passed to the XDocument.Load method:

0 commit comments

Comments
 (0)