koray bey
koray bey
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
why
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
I added async before void and its fixed
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
oh
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
Error CS4033 The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
void SendMessage(string message)
{
var eom = "<|EOM|>";
message += eom;
byte[] messageBuffer = Encoding.UTF8.GetBytes($"{username}: {message}\n");
await clientSocket.SendAsync(messageBuffer);
Console.WriteLine($"Socket client sent message: \"{message.Replace(eom, "")}\"");
}
void SendMessage(string message)
{
var eom = "<|EOM|>";
message += eom;
byte[] messageBuffer = Encoding.UTF8.GetBytes($"{username}: {message}\n");
await clientSocket.SendAsync(messageBuffer);
Console.WriteLine($"Socket client sent message: \"{message.Replace(eom, "")}\"");
}
I receieve error when I add await
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
do I need to add await in SendAsync if I use it to create a method
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
or should I learn sql-like things
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
would creating a class for users and a list containing that users work?
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
Any idea how can I implement usernames
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
what if I don't discard? would that cause me problems?
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
_ = await client.SendAsync(messageBytes, SocketFlags.None);
_ = await client.SendAsync(messageBytes, SocketFlags.None);
do I need to use "_" can't I just await client without declaring anything?
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
await client.ConnectAsync(ipEndPoint); what does this do wait until connection then perform the while loop?
32 replies
CC#
Created by koray bey on 5/7/2024 in #help
Socket Console App
why does the snippet use async
32 replies
CC#
Created by koray bey on 5/6/2024 in #help
LINQ Help
yeah the .Zip and .All methods I don't know what are they used for also I am not familiar with lambdas, I will work on it.
22 replies
CC#
Created by koray bey on 5/6/2024 in #help
LINQ Help
Yes both.
22 replies
CC#
Created by koray bey on 5/6/2024 in #help
LINQ Help
The main part I'm stuck is at learning these concepts.
22 replies
CC#
Created by koray bey on 5/6/2024 in #help
LINQ Help
Alright, what do you think about rest of the question?
22 replies
CC#
Created by koray bey on 5/6/2024 in #help
Confused about if statements
fixed seems like bools also need double equal signs
2 replies
CC#
Created by koray bey on 5/5/2024 in #help
Avalonia Beginner
thanks
47 replies
CC#
Created by koray bey on 5/5/2024 in #help
Avalonia Beginner
Well how do I get that understanding cause normally I try to create a project using my knowledge, even though I know a bit of OOP I couldn't think of a project I would use it,(or it gets too complicated for me) what should my approach be in this kind of situations?
47 replies