I've been doing this shit for almost 4 months now. About to finally get some offers at least. Gonna double my pay, lol
Going through this now, man. Seems like pure luck to get an offer. There really doesn't seem to be much leeway. Either you blow them away or fail. Having to start from scratch after 4-5 hours of interviews gets exasperating.
I typically spend 5-6 hours in meeting all week; last quarter my company made a concerted effort to cram all standard meetings into the 11-12am time slot which has proved quite nice
I've been doing this shit for almost 4 months now. About to finally get some offers at least. Gonna double my pay, lol
Going through this now, man. Seems like pure luck to get an offer. There really doesn't seem to be much leeway. Either you blow them away or fail. Having to start from scratch after 4-5 hours of interviews gets exasperating.
A friend of mine mentioned that his company does full-day interviews for engineer applicants. Supposedly it's fairly informal but they bring an applicant on-site for an entire day where they meet their potential team, and have a mix of 1:1 and group interviews with people, join in on any meetings etc. Idea being that everybody in the team gets to weigh in on whether they'll be a good fit.
A fairly appealing position came up with them a couple months ago and I specifically didn't apply because the thought of flopping an interview and then needing to spend the rest of the day awkwardly hanging out was too much to bear.
I've been doing this shit for almost 4 months now. About to finally get some offers at least. Gonna double my pay, lol
Going through this now, man. Seems like pure luck to get an offer. There really doesn't seem to be much leeway. Either you blow them away or fail. Having to start from scratch after 4-5 hours of interviews gets exasperating.
A friend of mine mentioned that his company does full-day interviews for engineer applicants. Supposedly it's fairly informal but they bring an applicant on-site for an entire day where they meet their potential team, and have a mix of 1:1 and group interviews with people, join in on any meetings etc. Idea being that everybody in the team gets to weigh in on whether they'll be a good fit.
A fairly appealing position came up with them a couple months ago and I specifically didn't apply because the thought of flopping an interview and then needing to spend the rest of the day awkwardly hanging out was too much to bear.
Over here the interview part itself doesn't necessarily mean the team will be the ones doing it (though it may be the case that you get one or two during some of those.) But afterwards there is a "mingling" part where you go out with lunch with them and it's mostly about fit and the like. So it's really nice.
On the other side of it, it basically means that you can vote "no" if for whatever reason you didn't get a good feeling of the other candidate (read: using racist subtext? sounds like an asshole?)
Yeah, we interview similarly and it's not until we see multiple interviews fail to go well before we start thinking to pass. I'm sure you *could* fail our process in a single interview but you'd have to do something really egregious.
Yeah, we interview similarly and it's not until we see multiple interviews fail to go well before we start thinking to pass. I'm sure you *could* fail our process in a single interview but you'd have to do something really egregious.
"Take a dump on the CEO's desk" is at the end of the employment.
+2
Options
OrcaAlso known as EspressosaurusWrexRegistered Userregular
Yeah, we interview similarly and it's not until we see multiple interviews fail to go well before we start thinking to pass. I'm sure you *could* fail our process in a single interview but you'd have to do something really egregious.
"Take a dump on the CEO's desk" is at the end of the employment.
I feel like it sets the appropriate tone for our relationship if I do it at the beginning
TBH, if you're doing 5+ interviews, or a full fucking day, I'd much rather fail fast and be told that I'm not getting the job than wasting everyone's time with how ridiculous these interview processes are getting
TBH, if you're doing 5+ interviews, or a full fucking day, I'd much rather fail fast and be told that I'm not getting the job than wasting everyone's time with how ridiculous these interview processes are getting
It's weird to me that this seems like it's new to so many people. I've never had an on-site interview be less than 6 hours in my 16 year career. Maybe it's just spreading to new fields?
I do agree with you though regarding not wasting time. We try to do a good job of cutting it short if it's going *real* bad in the first half of the day.
TBH, if you're doing 5+ interviews, or a full fucking day, I'd much rather fail fast and be told that I'm not getting the job than wasting everyone's time with how ridiculous these interview processes are getting
It's weird to me that this seems like it's new to so many people. I've never had an on-site interview be less than 6 hours in my 16 year career. Maybe it's just spreading to new fields?
I do agree with you though regarding not wasting time. We try to do a good job of cutting it short if it's going *real* bad in the first half of the day.
I've had one loop run shorter than that for on-site, years ago, and it was because they literally couldn't find some of the interviewers. No, I did not come back when they decided they'd found them and could I please...
4-6 hours is pretty bog-standard, and in all honesty gives me as much a chance to feel the company/team out as it does them to see what I'm about. If I just talked to a "dev lead" who does nothing but barf technobabble in meaningless yet fancy combinations, or use words he clearly doesn't know the actual meaning of, that is A Sign, for instance. Hell, I'm even judging them on lunch. Fancy? Overly fancy? Your garden variety corporate canteen? Someone knows a nice deli nearby, or conversely, god help them, they try Subway? All important info, and I'm not kidding; I even quietly inspected their snack/coffee setup on the way in.
Fun fact, btw, never work anywhere there's a popcorn machine. Why? Isn't popcorn awesome? Yes, popcorn is awesome, and what are they using that thing to distract people from, hm?
I dunno we have a pretty sweet snack setup and I use it to distract myself, from doing work. No popcorn machine admittedly
Ah yeah see, "good snacks" is one thing. That's a good sign, though can also be the "and we hope you never go home..." thing.
But like, a popcorn machine, a random waffle maker, anything obvious, obtrusive, attention-getting, that's an eyebrow raiser. Just like "oh yeah we have a foosball table in the lobby 'cause we're Cool and Fun no big deal". For instance those donut machines, the things that automatically make and fry mini donuts. I fucking LOVE those things, there's nothing quite like a fresh hot minidonut that's so much so it's melting the sprinkles you put on. But if that shows up in my office one day, my first question is "why is this in my office, what don't they want me to look at?" (Which I will obviously say with a mouthful of donut, because I'm not insane, but still.)
TBH, if you're doing 5+ interviews, or a full fucking day, I'd much rather fail fast and be told that I'm not getting the job than wasting everyone's time with how ridiculous these interview processes are getting
It's weird to me that this seems like it's new to so many people. I've never had an on-site interview be less than 6 hours in my 16 year career. Maybe it's just spreading to new fields?
I do agree with you though regarding not wasting time. We try to do a good job of cutting it short if it's going *real* bad in the first half of the day.
I've had one loop run shorter than that for on-site, years ago, and it was because they literally couldn't find some of the interviewers. No, I did not come back when they decided they'd found them and could I please...
4-6 hours is pretty bog-standard, and in all honesty gives me as much a chance to feel the company/team out as it does them to see what I'm about. If I just talked to a "dev lead" who does nothing but barf technobabble in meaningless yet fancy combinations, or use words he clearly doesn't know the actual meaning of, that is A Sign, for instance. Hell, I'm even judging them on lunch. Fancy? Overly fancy? Your garden variety corporate canteen? Someone knows a nice deli nearby, or conversely, god help them, they try Subway? All important info, and I'm not kidding; I even quietly inspected their snack/coffee setup on the way in.
Fun fact, btw, never work anywhere there's a popcorn machine. Why? Isn't popcorn awesome? Yes, popcorn is awesome, and what are they using that thing to distract people from, hm?
Pre-pandemic we had popcorn fridays at work. It was the best.
We have a popcorn machine because it was a junked broken thing and a few folks wanted to make a project out of rebuilding it ^_^
Now we have two popcorn machines cause the first one was a success and so they bought another broken one and fixed that too. They aren't running all the time though, just when someone feels like it or there's a party.
TBH, if you're doing 5+ interviews, or a full fucking day, I'd much rather fail fast and be told that I'm not getting the job than wasting everyone's time with how ridiculous these interview processes are getting
It's weird to me that this seems like it's new to so many people. I've never had an on-site interview be less than 6 hours in my 16 year career. Maybe it's just spreading to new fields?
I do agree with you though regarding not wasting time. We try to do a good job of cutting it short if it's going *real* bad in the first half of the day.
Yeah I don't think I've spent more than an hour in an interview. It's generally the standard questions about why I'm looking for a new job and questions for them. I've been lucky enough not to have to do technical tests which I am 100% sure I'll fail.
I'm trying to brush up on Python and I'm terrible at self-directed projects, so I've just been looking at Leetcode problems. Anyone have a favorite tutorial/project/series? I think I get Udemy via my library card...
I'm trying to brush up on Python and I'm terrible at self-directed projects, so I've just been looking at Leetcode problems. Anyone have a favorite tutorial/project/series? I think I get Udemy via my library card...
I second advent of code. I like the way the series usually turn from individual problems into a mini project by the end, and you can go through all the previous years willy nilly.
I'm trying to brush up on Python and I'm terrible at self-directed projects, so I've just been looking at Leetcode problems. Anyone have a favorite tutorial/project/series? I think I get Udemy via my library card...
I'm trying to brush up on Python and I'm terrible at self-directed projects, so I've just been looking at Leetcode problems. Anyone have a favorite tutorial/project/series? I think I get Udemy via my library card...
Could always try Advent of Code
Yep, especially since later problems often build on earlier ones, it's nice to have to refactor your own code as practice.
sometimes, for reasons I cannot determine, the proxy fails and nginx returns 504
during this time, gunicorn seems totally fine, logs quiet, no resource strain, etc... nginx logs just have some generic "upstream not found"... its definitely no longer sending the requests to gunicorn
this happens somewhere between one a month and once a week but seems to be triggered by high levels of requests
i am using a TCP configuration, not a socket. i am pretty sure the problem is with nginx. I had a healthcheck that restarted gunicorn in reaction to the 504 and it achieved nothing. if i restart nginx is is fixed instantly.
my nginx.conf looks somewhat similar to the one in the link above, although I do SSL stuff, so I have blocks for that, and I don't have anything preceding the http block (I think their conf format is outdated because if I try to cargo cult that section nginx will just reject it)
only other thing in the nginx logs that might be a clue is I seem to get a lot of buffering, and I am not sure why....
[warn] 7#7: *3539 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000552
but I get those *all* the time, not just when it fails. i've increased the buffer sizes for the proxy some, but I honestly haven't been able to detect any benefit and am not sure its related to the issue
anyway, for now its no big deal. i've broadened and strengthened the healthcheck so that everything gets restarted properly when it needs to... I'm just nervous about a potential ticking timebomb situation where something that used to happen once a week suddenly starts happening once an hour
God. One of the lead devs went on vacation for a week. The only bit of information he left me was "if they have issues seeing transactions in the other database, run this script". Cool. I get an email today "Hey Honky, <dev> was supposed to write a stored procedure and update something for us this week. Can we connect and discuss getting it out there by the end of the week?"
I've responded that I have zero idea of what they are talking about but they still insist that I attend a meeting to catch me up. Lead dev was the man who did all the SQL stuff because my brain exploded looking at this code several years ago (SQL written in 1998 no less).
0
Options
gavindelThe reason all your softwareis brokenRegistered Userregular
God. One of the lead devs went on vacation for a week. The only bit of information he left me was "if they have issues seeing transactions in the other database, run this script". Cool. I get an email today "Hey Honky, <dev> was supposed to write a stored procedure and update something for us this week. Can we connect and discuss getting it out there by the end of the week?"
I've responded that I have zero idea of what they are talking about but they still insist that I attend a meeting to catch me up. Lead dev was the man who did all the SQL stuff because my brain exploded looking at this code several years ago (SQL written in 1998 no less).
Ah, yes, the good old "Spend a week to fix something that the other guy would have banged out in 20 minutes."
Call it a learning opportunity. Maybe weep a little on the side.
So I'm trying my hand at networking for the first time and I am just having... the worst time with it.
I'm trying to make a monopoly client for monopd.
First I tried to get the server code to compile under windows, but it looks like, Microsoft, being the jackholes they are, decided to make a not-quite-code-compatible version of sockets and that was a bust. So I got monopd to compile under Cygwin with a modified makefile.. OK, that's sorted But now I'm trying to make my own client. It's super simple.. You send it a plain text command that starts with a period for example ".n hello" and you suck down the XML it sends back, and it looks like I can do that with some example code that Microsoft has and it works! Then, when I try to do *ANYTHING* else it just breaks in weird ways.
Here is the example Micorsoft code... it looks shocking straightforward. You send it some stuff and you get stuff back.. Perfect!
I modified it a bit to connect to 127.0.0.1 and my port (1234) and when I connected, it just hung.. It turns out you have to send something first. Just send a simple "\n" and out comes the XML! YAY! I modified it again to make the receive buffer a little bigger from 512 bytes to 4k. When I tried to send some more info to complete the handshake that when it went off the rails. I tried to send some more data and I got an error that the socket was closed. Why? I didn't give it a shutdown command yet. It seems like after it finishes sending me data it just up and disconnects.
Ok, fine, I'll just reconnect again, and now I'm getting a invalid socket error.
Right new socket then.. Oh, now it thinks I'm a brand new connection and starts over the handshake process.
I don't get this. You would think a back/forth connection would be one of the most boiler plate plate of boiler plate code, but the system seems to be designed to only allow a singe back and forth and then drops. How do you keep the connection open? Is there any standard code on how to do this? If this is some kind ridiculous black art can someone recommend a Nuget lib or another example I can pull from so I can get to the actual XML processing bit.
My hacky playground is here... I'm not doing loops or anything, I'm just trying different calls to make the connection stable. https://pastebin.com/MR4mmSh8
I feel I'm almost there... I'm missing the magic sauce to keep the connection open.
So I'm trying my hand at networking for the first time and I am just having... the worst time with it.
I'm trying to make a monopoly client for monopd.
First I tried to get the server code to compile under windows, but it looks like, Microsoft, being the jackholes they are, decided to make a not-quite-code-compatible version of sockets and that was a bust. So I got monopd to compile under Cygwin with a modified makefile.. OK, that's sorted But now I'm trying to make my own client. It's super simple.. You send it a plain text command that starts with a period for example ".n hello" and you suck down the XML it sends back, and it looks like I can do that with some example code that Microsoft has and it works! Then, when I try to do *ANYTHING* else it just breaks in weird ways.
Here is the example Micorsoft code... it looks shocking straightforward. You send it some stuff and you get stuff back.. Perfect!
I modified it a bit to connect to 127.0.0.1 and my port (1234) and when I connected, it just hung.. It turns out you have to send something first. Just send a simple "\n" and out comes the XML! YAY! I modified it again to make the receive buffer a little bigger from 512 bytes to 4k. When I tried to send some more info to complete the handshake that when it went off the rails. I tried to send some more data and I got an error that the socket was closed. Why? I didn't give it a shutdown command yet. It seems like after it finishes sending me data it just up and disconnects.
Ok, fine, I'll just reconnect again, and now I'm getting a invalid socket error.
Right new socket then.. Oh, now it thinks I'm a brand new connection and starts over the handshake process.
I don't get this. You would think a back/forth connection would be one of the most boiler plate plate of boiler plate code, but the system seems to be designed to only allow a singe back and forth and then drops. How do you keep the connection open? Is there any standard code on how to do this? If this is some kind ridiculous black art can someone recommend a Nuget lib or another example I can pull from so I can get to the actual XML processing bit.
My hacky playground is here... I'm not doing loops or anything, I'm just trying different calls to make the connection stable. https://pastebin.com/MR4mmSh8
I feel I'm almost there... I'm missing the magic sauce to keep the connection open.
There's nothing in the OSI model that says that's right or wrong, that's application decided at that point. If the application expects a connection, receives a command, returns a response, closes the connection, then that's what it is.
An example is that HTTP keep-alive is built on top of the TCP protocol, but it's the HTTP protocol that is managing the session layer, and has its own keep-alive agreement between client and server. Keeping or closing the socket is totally up to the applications at this point and not the low level socket that you're interfacing with.
That doesn't seem right... for example...
When I connect with Putty to telnet to the server, everything works peachy keen. I connect and the response XML just pops up in the terminal. (Without me hitting "return" first.) then in Putty I can manually type the "." commands and when I press enter, the XML comes back. Putty doesn't disconnect after just one command. In fact I can (esoterically) play the whole game via the terminal by human parsing the XML and sending the "." commands listed in the API.
So it's not the server dropping the connection. I'm using the most bare-bones of a connection via putty and it can hold the connection fine.
So I guess I'm trying to make a little mini terminal emulator and using that as a starting point. However, when with I think about it like that, I found a tiny tenet client that is about 160 lines long. I'll give that a shot as my base client.
So I'm trying my hand at networking for the first time and I am just having... the worst time with it.
I'm trying to make a monopoly client for monopd.
First I tried to get the server code to compile under windows, but it looks like, Microsoft, being the jackholes they are, decided to make a not-quite-code-compatible version of sockets and that was a bust. So I got monopd to compile under Cygwin with a modified makefile.. OK, that's sorted But now I'm trying to make my own client. It's super simple.. You send it a plain text command that starts with a period for example ".n hello" and you suck down the XML it sends back, and it looks like I can do that with some example code that Microsoft has and it works! Then, when I try to do *ANYTHING* else it just breaks in weird ways.
Here is the example Micorsoft code... it looks shocking straightforward. You send it some stuff and you get stuff back.. Perfect!
I modified it a bit to connect to 127.0.0.1 and my port (1234) and when I connected, it just hung.. It turns out you have to send something first. Just send a simple "\n" and out comes the XML! YAY! I modified it again to make the receive buffer a little bigger from 512 bytes to 4k. When I tried to send some more info to complete the handshake that when it went off the rails. I tried to send some more data and I got an error that the socket was closed. Why? I didn't give it a shutdown command yet. It seems like after it finishes sending me data it just up and disconnects.
Ok, fine, I'll just reconnect again, and now I'm getting a invalid socket error.
Right new socket then.. Oh, now it thinks I'm a brand new connection and starts over the handshake process.
I don't get this. You would think a back/forth connection would be one of the most boiler plate plate of boiler plate code, but the system seems to be designed to only allow a singe back and forth and then drops. How do you keep the connection open? Is there any standard code on how to do this? If this is some kind ridiculous black art can someone recommend a Nuget lib or another example I can pull from so I can get to the actual XML processing bit.
My hacky playground is here... I'm not doing loops or anything, I'm just trying different calls to make the connection stable. https://pastebin.com/MR4mmSh8
I feel I'm almost there... I'm missing the magic sauce to keep the connection open.
So with sockets either side can at any time decide to close their send channel and the other side will be informed of this, typically by a successful read of zero bytes (there's also the abrupt close where you cause read errors). How you keep the connection open is protocol-specific. As this is an XML protocol I'm going to guess that with you sending "\n" then server is going "WTF is this shit? Have a nicely formatted XML error and then GOOD DAY SIR"
edit: nevermind looked at your sample code
iResult = shutdown(ConnectSocket, SD_SEND);
don't close your send channel, that's telling the server goodbye. You also can't read until the server closes the channel, you need to parse it to figure out the logical end-of-message point
That doesn't seem right... for example...
When I connect with Putty to telnet to the server, everything works peachy keen. I connect and the response XML just pops up in the terminal. (Without me hitting "return" first.) then in Putty I can manually type the "." commands and when I press enter, the XML comes back. Putty doesn't disconnect after just one command. In fact I can (esoterically) play the whole game via the terminal by human parsing the XML and sending the "." commands listed in the API.
So it's not the server dropping the connection. I'm using the most bare-bones of a connection via putty and it can hold the connection fine.
So I guess I'm trying to make a little mini terminal emulator and using that as a starting point. However, when with I think about it like that, I found a tiny tenet client that is about 160 lines long. I'll give that a shot as my base client.
It's still the case, it just is your original assertion that you're not shutting down the connection was incorrect?
I've been doing this shit for almost 4 months now. About to finally get some offers at least. Gonna double my pay, lol
Going through this now, man. Seems like pure luck to get an offer. There really doesn't seem to be much leeway. Either you blow them away or fail. Having to start from scratch after 4-5 hours of interviews gets exasperating.
A friend of mine mentioned that his company does full-day interviews for engineer applicants. Supposedly it's fairly informal but they bring an applicant on-site for an entire day where they meet their potential team, and have a mix of 1:1 and group interviews with people, join in on any meetings etc. Idea being that everybody in the team gets to weigh in on whether they'll be a good fit.
A fairly appealing position came up with them a couple months ago and I specifically didn't apply because the thought of flopping an interview and then needing to spend the rest of the day awkwardly hanging out was too much to bear.
"Fit" is a horrible metric that needs to die in a fire.
Posts
Going through this now, man. Seems like pure luck to get an offer. There really doesn't seem to be much leeway. Either you blow them away or fail. Having to start from scratch after 4-5 hours of interviews gets exasperating.
The more time you spend going "but whyyyyyy", the more obvious the reason is once you find it.
It's a misspelling. Or worse, just a plural/singular thing
God this. There's this XML I deal with where it's backwards to what you expect:
Products is the object and product is the array of Products.
A fairly appealing position came up with them a couple months ago and I specifically didn't apply because the thought of flopping an interview and then needing to spend the rest of the day awkwardly hanging out was too much to bear.
Over here the interview part itself doesn't necessarily mean the team will be the ones doing it (though it may be the case that you get one or two during some of those.) But afterwards there is a "mingling" part where you go out with lunch with them and it's mostly about fit and the like. So it's really nice.
On the other side of it, it basically means that you can vote "no" if for whatever reason you didn't get a good feeling of the other candidate (read: using racist subtext? sounds like an asshole?)
"Take a dump on the CEO's desk" is at the end of the employment.
I feel like it sets the appropriate tone for our relationship if I do it at the beginning
I do agree with you though regarding not wasting time. We try to do a good job of cutting it short if it's going *real* bad in the first half of the day.
I've had one loop run shorter than that for on-site, years ago, and it was because they literally couldn't find some of the interviewers. No, I did not come back when they decided they'd found them and could I please...
4-6 hours is pretty bog-standard, and in all honesty gives me as much a chance to feel the company/team out as it does them to see what I'm about. If I just talked to a "dev lead" who does nothing but barf technobabble in meaningless yet fancy combinations, or use words he clearly doesn't know the actual meaning of, that is A Sign, for instance. Hell, I'm even judging them on lunch. Fancy? Overly fancy? Your garden variety corporate canteen? Someone knows a nice deli nearby, or conversely, god help them, they try Subway? All important info, and I'm not kidding; I even quietly inspected their snack/coffee setup on the way in.
Fun fact, btw, never work anywhere there's a popcorn machine. Why? Isn't popcorn awesome? Yes, popcorn is awesome, and what are they using that thing to distract people from, hm?
Ah yeah see, "good snacks" is one thing. That's a good sign, though can also be the "and we hope you never go home..." thing.
But like, a popcorn machine, a random waffle maker, anything obvious, obtrusive, attention-getting, that's an eyebrow raiser. Just like "oh yeah we have a foosball table in the lobby 'cause we're Cool and Fun no big deal". For instance those donut machines, the things that automatically make and fry mini donuts. I fucking LOVE those things, there's nothing quite like a fresh hot minidonut that's so much so it's melting the sprinkles you put on. But if that shows up in my office one day, my first question is "why is this in my office, what don't they want me to look at?" (Which I will obviously say with a mouthful of donut, because I'm not insane, but still.)
Pre-pandemic we had popcorn fridays at work. It was the best.
No, I still don't want to go back to the office.
Now we have two popcorn machines cause the first one was a success and so they bought another broken one and fixed that too. They aren't running all the time though, just when someone feels like it or there's a party.
Yeah I don't think I've spent more than an hour in an interview. It's generally the standard questions about why I'm looking for a new job and questions for them. I've been lucky enough not to have to do technical tests which I am 100% sure I'll fail.
Could always try Advent of Code
Exercism's medium and hard problems tend to be more complete projects.
Yep, especially since later problems often build on earlier ones, it's nice to have to refactor your own code as practice.
i have nginx serving as a proxy for a python web application served by gunicorn (https://docs.gunicorn.org/en/stable/deploy.html)
sometimes, for reasons I cannot determine, the proxy fails and nginx returns 504
this happens somewhere between one a month and once a week but seems to be triggered by high levels of requests
i am using a TCP configuration, not a socket. i am pretty sure the problem is with nginx. I had a healthcheck that restarted gunicorn in reaction to the 504 and it achieved nothing. if i restart nginx is is fixed instantly.
my nginx.conf looks somewhat similar to the one in the link above, although I do SSL stuff, so I have blocks for that, and I don't have anything preceding the http block (I think their conf format is outdated because if I try to cargo cult that section nginx will just reject it)
only other thing in the nginx logs that might be a clue is I seem to get a lot of buffering, and I am not sure why....
but I get those *all* the time, not just when it fails. i've increased the buffer sizes for the proxy some, but I honestly haven't been able to detect any benefit and am not sure its related to the issue
anyway, for now its no big deal. i've broadened and strengthened the healthcheck so that everything gets restarted properly when it needs to... I'm just nervous about a potential ticking timebomb situation where something that used to happen once a week suddenly starts happening once an hour
I've responded that I have zero idea of what they are talking about but they still insist that I attend a meeting to catch me up. Lead dev was the man who did all the SQL stuff because my brain exploded looking at this code several years ago (SQL written in 1998 no less).
Ah, yes, the good old "Spend a week to fix something that the other guy would have banged out in 20 minutes."
Call it a learning opportunity. Maybe weep a little on the side.
I'm trying to make a monopoly client for monopd.
First I tried to get the server code to compile under windows, but it looks like, Microsoft, being the jackholes they are, decided to make a not-quite-code-compatible version of sockets and that was a bust. So I got monopd to compile under Cygwin with a modified makefile.. OK, that's sorted But now I'm trying to make my own client. It's super simple.. You send it a plain text command that starts with a period for example ".n hello" and you suck down the XML it sends back, and it looks like I can do that with some example code that Microsoft has and it works! Then, when I try to do *ANYTHING* else it just breaks in weird ways.
Here is the example Micorsoft code... it looks shocking straightforward. You send it some stuff and you get stuff back.. Perfect!
I modified it a bit to connect to 127.0.0.1 and my port (1234) and when I connected, it just hung.. It turns out you have to send something first. Just send a simple "\n" and out comes the XML! YAY! I modified it again to make the receive buffer a little bigger from 512 bytes to 4k. When I tried to send some more info to complete the handshake that when it went off the rails. I tried to send some more data and I got an error that the socket was closed. Why? I didn't give it a shutdown command yet. It seems like after it finishes sending me data it just up and disconnects.
Ok, fine, I'll just reconnect again, and now I'm getting a invalid socket error.
Right new socket then.. Oh, now it thinks I'm a brand new connection and starts over the handshake process.
I don't get this. You would think a back/forth connection would be one of the most boiler plate plate of boiler plate code, but the system seems to be designed to only allow a singe back and forth and then drops. How do you keep the connection open? Is there any standard code on how to do this? If this is some kind ridiculous black art can someone recommend a Nuget lib or another example I can pull from so I can get to the actual XML processing bit.
My hacky playground is here... I'm not doing loops or anything, I'm just trying different calls to make the connection stable.
https://pastebin.com/MR4mmSh8
I feel I'm almost there... I'm missing the magic sauce to keep the connection open.
There's nothing in the OSI model that says that's right or wrong, that's application decided at that point. If the application expects a connection, receives a command, returns a response, closes the connection, then that's what it is.
An example is that HTTP keep-alive is built on top of the TCP protocol, but it's the HTTP protocol that is managing the session layer, and has its own keep-alive agreement between client and server. Keeping or closing the socket is totally up to the applications at this point and not the low level socket that you're interfacing with.
When I connect with Putty to telnet to the server, everything works peachy keen. I connect and the response XML just pops up in the terminal. (Without me hitting "return" first.) then in Putty I can manually type the "." commands and when I press enter, the XML comes back. Putty doesn't disconnect after just one command. In fact I can (esoterically) play the whole game via the terminal by human parsing the XML and sending the "." commands listed in the API.
So it's not the server dropping the connection. I'm using the most bare-bones of a connection via putty and it can hold the connection fine.
So I guess I'm trying to make a little mini terminal emulator and using that as a starting point. However, when with I think about it like that, I found a tiny tenet client that is about 160 lines long. I'll give that a shot as my base client.
So with sockets either side can at any time decide to close their send channel and the other side will be informed of this, typically by a successful read of zero bytes (there's also the abrupt close where you cause read errors). How you keep the connection open is protocol-specific. As this is an XML protocol I'm going to guess that with you sending "\n" then server is going "WTF is this shit? Have a nicely formatted XML error and then GOOD DAY SIR"
edit: nevermind looked at your sample code
iResult = shutdown(ConnectSocket, SD_SEND);
don't close your send channel, that's telling the server goodbye. You also can't read until the server closes the channel, you need to parse it to figure out the logical end-of-message point
It's still the case, it just is your original assertion that you're not shutting down the connection was incorrect?
"Fit" is a horrible metric that needs to die in a fire.
Three, apparently. We ended up in some really weird state somehow.
https://grugbrain.dev/
"The Grug Brained Developer: A layman's guide to thinking like the self-aware smol brained"
I found it reassuring.