knut.wannheden
knut.wannheden
CC#
Created by knut.wannheden on 7/1/2024 in #help
✅ dotnet.microsoft.com is down
Sorry, was supposed to go into #chat 🙈
6 replies
CC#
Created by knut.wannheden on 7/1/2024 in #help
✅ dotnet.microsoft.com is down
It's up again 😊
6 replies
CC#
Created by knut.wannheden on 5/16/2024 in #help
Definitive C# language reference?
Thanks for the link to the grammar! I didn't know it was publicly available on GitHub.
22 replies
CC#
Created by knut.wannheden on 5/16/2024 in #help
Definitive C# language reference?
Thanks! So I guess it can take some time until we get a reference for C# 12 or 13.
22 replies
CC#
Created by knut.wannheden on 5/16/2024 in #help
Definitive C# language reference?
22 replies
CC#
Created by knut.wannheden on 5/14/2024 in #help
Generic types API design
In Roslyn I did find some types where there are both generic and non-generic versions (e.g. CSharpSyntaxVisitor), but they don't inherit from each other, which I suspect is weird. I suppose I could always add another interface, which they both extend.
5 replies
CC#
Created by knut.wannheden on 5/13/2024 in #help
Best practice reading from `Socket` / `NetworkStream`?
Ideally, I would prefer if the CborReader could read directly from the stream.
12 replies
CC#
Created by knut.wannheden on 5/13/2024 in #help
Best practice reading from `Socket` / `NetworkStream`?
Indeed. I just couldn't figure out before why the CopyTo() call was always blocking.
12 replies
CC#
Created by knut.wannheden on 5/13/2024 in #help
Best practice reading from `Socket` / `NetworkStream`?
I was able to get the sending application to shutdown the connection for writing without closing the socket (as I still want to send a response on the C# side). That way your approach with CopyTo() then works as expected. Thanks!
12 replies
CC#
Created by knut.wannheden on 5/13/2024 in #help
Best practice reading from `Socket` / `NetworkStream`?
I've tried this, but I think this requires the sending application to somehow close the socket, because whenever I try this, the operation is blocking with the following stack trace:
Interop.Sys.ReceiveMessage() at /Users/knut/Library/Application Support/JetBrains/Rider2024.1/resharper-host/DecompilerCache/decompiler/ac2d207955094b78acaf0bd37a9cfa67a5000/0d/bf21a485/Interop.cs:line 932
SocketPal.SysReceive()
SocketPal.TryCompleteReceiveFrom()
SocketAsyncContext.ReceiveFrom()
Socket.Receive()
NetworkStream.Read()
Stream.CopyTo()
Program.ReadFully()
Interop.Sys.ReceiveMessage() at /Users/knut/Library/Application Support/JetBrains/Rider2024.1/resharper-host/DecompilerCache/decompiler/ac2d207955094b78acaf0bd37a9cfa67a5000/0d/bf21a485/Interop.cs:line 932
SocketPal.SysReceive()
SocketPal.TryCompleteReceiveFrom()
SocketAsyncContext.ReceiveFrom()
Socket.Receive()
NetworkStream.Read()
Stream.CopyTo()
Program.ReadFully()
12 replies
CC#
Created by knut.wannheden on 4/23/2024 in #help
primary constructor naming convention
I see. Thanks! I was just wondering if there was some established convention to resolve these kinds of conflicts.
10 replies
CC#
Created by knut.wannheden on 4/23/2024 in #help
primary constructor naming convention
It is a silly example which would be better done with records, as you say. I was just trying to use something simple to convey the question.
10 replies
CC#
Created by knut.wannheden on 4/23/2024 in #help
primary constructor naming convention
class Point(int x, int y)
{
Point Offset(int x, int y)
{
// ???
}
}
class Point(int x, int y)
{
Point Offset(int x, int y)
{
// ???
}
}
10 replies