« first day (3463 days earlier)      last day (1478 days later) » 

mr5
11:00 AM
there are so many opportunities I am missing already because I can't give them CVs
 
I just have like a table on my Résumé with my personal and professional projects with technologies used.
 
mr5
Do you think a simple <table><tr><td>I made dis</td></tr><table> would work?
I made dis and dat and dos and dis
 
Then I have it in a google drive folder with my other documents and certifications. I gave a link to that folder to any recruiters I talked to. They were pleasently surprised every time.
I made it in word and then into pdf for sharing.
 
mr5
is it presentable?
are you articulate in describing your work?
I'm pretty sure I can make software but I can't make a fine details of my work and make it appealing to potential clients.
I feel like I can't respond to a question of something like "how did you make project X? what challenges did you face during the development phase?"
what challenges did you face during the development phase?
what circumstances did you ace to close the case?
 
hi guys
i have a quick question
 
mr5
11:07 AM
@c0dem0nkey yoo shoot your question!! I'm always here 25/8
 
love that
say i wanted to discuss the architecture of some piece of code
does that qualify for a full-on question
or is it fine here
im confused
what is this chat channel for anyway
 
mr5
this chat is for discussing anything other than programming related stuffs
jk
well, for your other question, I'm not so sure what you mean by full-on question.
 
should i ask on stack overflow, or here
basically
 
mr5
oh
you can ask here if you just want to make it casual
 
mr5
11:11 AM
SO answers are for professional level only
 
say i have a Socket
and i want to receie UDP packets
i have something working
 
mr5
I don't fall in that category just to be clear ^^
 
@mr5 doubt - [x]
 
mr5
I mean, I made a professional answers back in the days
 
ok ok, but how would i debug the Socket not receiving certain client packets
its more on the debugging
bc im frustrated at not being able to
TCP works brilliantly
 
mr5
11:12 AM
-3
A: Convert 0x1234 to 0x11223344

mr5While others operate on hard-core optimization... Take this as your best bet: std::string toAARRGGBB(const std::string &argb) { std::string ret("0x"); int start = 2; //"0x####"; // ^^ skipped for (int i = start;i < argb.length(); ++i) { ret += argb[i...

 
Are you sure that its not receiving them?
 
yes
but UDP is such a pain
100% certain
 
Are you sure that its not recieving them and throwing an error when it does?
 
I've been stung by that before
Can you see the packet leave the client?
 
11:13 AM
its synchronous and wrapped in a try catch block, which prints to console
yes
 
mr5
@MikołajLenczewski have your tried logging?
 
Do you have anything before it?
 
the client sends data, and waits for ever as the server never responds
 
and before you say yes, are you 100000% sure
 
yes
the server is pinned at 100%
and since the clients log their network operations to the console, i know that the clients which are left behind send packets and never receive a response. the server is a simple echo server
so it takes a request and immediately sends it back
since the server is at 100% utilisation on only 16 clients, whenever i add more there are a bunch which never get served
 
11:16 AM
what are you using for your traffic?
 
what do you mean
UDP
 
100% utilisation for 16 clients seems excessive
 
like are you using a library or homebrew UDP
 
thats the problem
 
11:16 AM
whats the specs for the machine its running on?
 
the C# std Sockets and SocketAsyncEventArgs
8 core ryzen 1700, at 3.2 GHz boost
 
oooooooooooookay
 
and this is running on my LAN
so i dont expect packets to be lost
 
you definately shouldn't be encountering that then lmao
 
its very aids
i know
 
11:18 AM
Do you have any loops or any lists or anything?
 
what do you mean by that?
 
Like
do you have any for, foreach loops etc
do you have any List<T>, HashSet<T> etc etc
 
oh ok
sec
 
thats the core loop for the server
 
11:19 AM
while (!cancellationToken.IsCancellationRequested)
 
Hey uhhhh why not SignalR
 
the cancellation token is never called
 
That could have an impact on your utilisation
my point exactly
so that loop is just Constantly going
 
yes
the opposite is a try catch
 
mr5
okay
 
11:20 AM
Imma be honest
 
mr5
is this callback not called in multiple threads?
 
That loop jsut waits for clients to cnnect though?
 
I'd scrap what you've got and implement signalr
 
but why tho
 
because then you don't have to deal with this issue
 
11:20 AM
when i can be masochistic and try to learn SocketAsyncEventArgs :)
 
and its a microsoft lib
its very good
 
its the standard library
 
Also because signalr has fallback to SSE and even long polling when your websocket fails
 
i mean, you are welcome to keep on trying to re-invent the wheel
 
this isnt web
 
11:21 AM
And you don't have to implement anything
 
signalr isn't exclusive to web
 
or so im told by wikipedia
and signalr is for web apps
 
it has c# clients too
@MikołajLenczewski its really not
it's heavily geared towards that
but there is a c# client for it
source: i wrote a live chat system with it that had implementations to a server sided app and js clients
 
I mean, if your WPF application uses http to communicate via the internet, isn't it technically a web app?
 
i mean, my implentation was kinda bad and the app had its quirks, but with enough time learning about signalr you can make a pretty good thing
 
11:23 AM
if im ever gonna do something important, ill try out SignalR. but rn i want to try to learn how to use the SocketAsyncEventArgs and relevant socket methods properly.
 
Also yeah I went full loop and used it in Blazor, so I used the C# client but then shoved it into a browser :D
 
this is more as a learning experience
 
is blazor still slow as balls?
or is it better now
 
It's significantly faster with the latest preview
 
11:23 AM
don't get me wrong, learning is gud
but learning the right things is better
especially if its a widely used thing
like signalr
(I'm not saying what you are using isn't, but signalr is better to use than trying to solve issues like this yourself)
 
look, i appreciate that you are trying to help me learn the right thing. I get that. and signalR might be the best thing ever (never tried it). honestly, thank you for that.
but
 
mr5
Imagine your server was setup like this:
server.OnRequest("address:port", callback)
callback {
while (true) { }
}

I do think it would halt for some time after this callback gets accumulated and didn't return from the stack.
 
Manager: "You know websockets? Nice, we need help with that kind of app right now!"
Senior Dev: "Why the hell would you build three giant classes yourself instead of just using SignalR?"
 
i also want to learn how to do this, lets say for the fun of it.
for the chemical high of accomplishing something hard
 
I mean, learning SignalR from nothing is gonna be hard too.
 
11:27 AM
@Squirrelkiller just humor me please
 
Honestly I wanted to do websockets too a while ago, exactly because "then i know how to use them and can say I did it!", but after much fucking around I realized, SignalR is just the better decision.
 
omg I'm so tired
 
If you don't have a damned good reason to avoid SignalR, you're literally wasting days. It takes less than an hour to get SignalR up and running.
 
= not hard
cool
i just want to finish what im doing, then i can go learn SignalR
its not that big a problem
 
It took me a whole weekend to realize I actually need that http endpoint to start a signalR connection...
 
mr5
11:28 AM
yeah right
start of by responding to me then
 
@Squirrelkiller You're a scrub.
 
@mr5 im not sure what you mean
 
I can accept that.
 
im looking at my code and comparing
gimme a sec
 
mr5
11:28 AM
8 mins ago, by mr5
is this callback not called in multiple threads?
 
theres no callback
as soon as a packet from a new endPoint is seen
a new client handler task is spun up
sorry for the delay
 
mr5
I mean the HandleClient is the callback used by the server isn't it?
 
no
its a task
 
@SquirrelInTraining get in here, you're the one who built basically exactly what this dude is trying to build currently!
 
its not a callback
 
11:30 AM
I want to use signalr but have no valid reason to do so that I can think og
 
Damn he's not even in the autocomplete-list anymore
 
mr5
okay
 
@CaptainObvious Build your own secure p2p chat app
 
mr5
so does it run on multiple threads?
 
But we already have 2
 
11:30 AM
@CaptainObvious We currently use it to send events from microservices to clients so they can refresh their pages automagically. It's nice.
 
I would use that but I have many many events
 
@Hozuki Sounds like resthooks basically
 
Basically, except that clients are websites in this case :p
 
@mr5 yes, each client handler task is run on a thread (i would think on the thread pool)
 
So the website/app gets a "Person x updated" and if they are on a page with person x, it just does a refresh.
 
mr5
11:32 AM
what does it mean when someone tells you you're are scrub?
 
Simple but beautiful results.
 
when i profile, i see a whole bunch of threads
 
mr5
I'm thinking sponge here
 
@CaptainObvious same
 
mr5
@MikołajLenczewski ok. first point. is your list thread safe?
 
11:32 AM
Can you show the code @MikołajLenczewski
 
every dictionary like thing is a concurrent dictionary
 
@Hozuki his code is here: pastebin.com/nmU45Ypb
 
11:33 AM
the datagram dir has the full code
 
a github link
 
for the server
the client rn is just a simple blocking synchronous affair
 
@Hozuki Hey that's basically what I'm gonna build for the teambuild webapp except I'll probably send somethinh like a PATCH to the client to directly update that one object
 
> raw sockets
 
yes
le big pain
 
11:34 AM
But whyyyyyyyy
 
for masochism and learning
3
this is entirely a hobby project its not too serious
 
mr5
eh, try putting a log under the handled exception.
 
if i want to do stuff properly ill look at signalr and other
where
 
mr5
right
 
@Squirrelkiller We thought about that, and yes, it's nice but it's so much more effort to get it right.
 
mr5
11:35 AM
get rid with those squirrels
they're no fun
3 mins ago, by mr5
what does it mean when someone tells you you're are scrub?
somebody answer my question pls
 
that ur a scrub
ya scrub
 
Masochism sure is right, you've got what, 10 files to do something you can do in 3 lines?
2
 
git gud
 
mr5
locking to a type. that's new to me
 
mr5
11:36 AM
I only thought you could lock on an instance
 
its just so that the console wont be fragmented like crazy
 
mr5
oh. Console is a static class
so basically, it's a singleton instance right?
 
every type is its own instance
its a singleton instance im pretty sure
 
mr5
have you tried doing this:
3 mins ago, by mr5
eh, try putting a log under the handled exception.
 
In other news, I'm doing a lazy loading endless reversed chat list UI thingy and it's hell.
 
11:38 AM
under which handled exception
 
mr5
OperationCanceledException in HandleClient
just to be sure it's not at all cancelling
@Hozuki personal project?
 
Unfortunately not
 
mr5
reminds me of my abandoned long-polling chat
 
the cancellation token passed in is CancellationToken.Empty (or default(CancellationToken)) so it can never be cancelled
thats there mainly for later, when i will be bothered to add cancellation
but ill add a console.writeline just in case
 
It's not that. It's a WhatsApp-style UI (newest messages at the bottom) with paged results from an API (say, 10 messages/request). As you scroll up, new messages must be loaded progressively and visibly, while also showing the correct dates etc.
 
mr5
11:40 AM
CancellationToken.Empty why didn't I knew this before
 
CancellationTokens are cool
but i think that CancellationToken.Empty is the same as default(CancellationToken)
it should be
 
mr5
yeah. used that a lot but I never know there was a CancellationToken.Empty
I always use the default one
 
fair enough
 
@mr5 for reference: this is the urban dictionary definition of a scrub
it's just like an insult without being overly insulting
 
I'd say it's quite insulting if it's true.
 
mr5
11:43 AM
so basically, in pseudocode, your code is just like this:
HandleClient {
    var request = awat ...
    var response = request
    var sendResult = SendResult(reponse)
}
 
mr5
maybe it has something to do by directly assigning the same reference
response = request
 
but since we have UDP, and we dont have a socket to read from, im reading from a channel
 
mr5
maybe you have to reset something there
 
11:44 AM
there's also this tune of a tune
 
since they are structs i would assume they simply get copied
 
mr5
@CaptainSquirrel Probably still lives with his mama, doesn't have a car, a job, or a plan.
this is what kind of definition I'm always after
not those fancy definitions
 
the contents of request are simply copied into response
and since the contents of NetworkPacket are all structs themselves, its just a deep copy
not a shallow copy as with classes and reference types
 
mr5
@MikołajLenczewski oh well. you think there's no class under the struct and somehow gets the same reference?
 
11:45 AM
those are a headache to follow
let me check
 
mr5
prolly a stream that can't be read and needs to flush down
 
i cant see any reference types
 
mr5
@Hozuki which web socket library are you using? is it a mobile app?
 
Memory<T> and ReadOnlyMemory<T> are readonly structs
and int and co are also structs
 
@mr5 SignalR, and yes.
 
mr5
11:47 AM
ehh, try to create a response from scratch
 
@Hozuki btw, if you want to see how bad the code actually got, do into the deprecated folder ;)
 
mr5
let's see what happens
@MikołajLenczewski I'd say you have a pretty clean code if you wrote that.
except the overly verbose types
 
look at this
this says otherwise
that was before the rewrite
focusing on only Sockets and basic sending of byte arrays
that code wanted to acheive way too much
yeah, verbosity is a big problem for me
bc descriptions are cool
 
mr5
nono
the type declaration
instead of just inferring it using var
@Hozuki eww signalR
why not PubNub
 
What?
SignalR works perfectly fine, why would I need something else?
 
mr5
11:51 AM
PubNub > all other web socket implementations
 
mr5
UDP or whatever that's called
 
aww
that doesnt work
:(
 
PubNub is not free to begin with... I don't see why I'd use that over SignalR (free + robust)
 
thats cool tho
none of my 16 clients have a problem
let me get 17 or more and you should see what i men
duplicating the request also did nothing
:(
 
mr5
11:53 AM
so every client being served will be assigned a dedicated threads?
 
(A reasonable machine with a good performing WS can handle more than a million clients)
 
it depends on the ThreadPool
 
mr5
afaik, you don't need multiple threads to handle clients
 
since im starting a task, it gets delegated to the ThreadPool and worked on there
im not starting a dedicated thread
i let the standard library handle that
 
(Threads are terrible, use I/O completion and async/await)
 
11:54 AM
thats exactly what im doind -_-
 
mr5
can you tweak the config if there's any as not to use a thread whenever a new client connects?
 
(Awesome)
 
mr5
(why are you writing in paren Roel?)
 
Why not
 
mr5
(it's like you're here but not)
 
11:55 AM
(to be here or not be here)
(is that the question?)
 
theres no connection, im using UDP. a new task is spun up whenever we receive a packet from a client. thats the problem, im not receiving the initial packet from the client
 
mr5
(assume you can't read out loud words inside paren)
 
im pretty sure
 
mr5
I'd conclude your server has autism
 
mr5
11:56 AM
why would he need to spawn a new thread for each client?
 
thats what happens with more than 16 clients
too true
 
mr5
can you make your own server?
a real masochist would create one
 
is that not what im doing?
XD
am i not masochistic enough already?
 
mr5
you're overriding stuffs and I think those are written by MS themselves
 
no im not???
where
im overriding abstract methods that i wrote in my own class
 
mr5
11:58 AM
is EnderEnterprises and you the same persona?
o i c
 
mr5
I just thought
 
where did you get ender enterprises from
have i not updated my SO profile?
probably
 
mr5
how could you write all those classes while it not performing its primary purpose?
 
all i can say is that it works for 16
any more and it shits itself
16 clients is the max
 
mr5
11:59 AM
oh if you wrote those server, stop spawning threads then
 

« first day (3463 days earlier)      last day (1478 days later) »