quasi random (kaolinfire) wrote,
quasi random
kaolinfire

and I continue to show my ignorance...

same project, different day. but they're all the same day because it's the same project (no, I am getting sleep and such... it just doesn't seem like anything changes...)

here's a record of some of my a)stupidity and b)confusion...

so... I've got a method that could be called "at any time", yadda...

now, java doesn't have this "variables declared on the stack" versus "variables declared on the heap" business...

I guess I don't have any experience with threaded c apps. at least, not with threads that did anything important...

okay, so... I've got a method that could be called "at any time", yadda.

it's: void response(char *);

now in response, I want to build a char* and "send" it. send is asynchronous as far as I can tell -- it doesn't wait for the thing to actually be sent before returning.

so if I make buf (the char* I'm building) a malloc'd entity... oh, duh. that works just fine. I was for some reason making it a globally malloc'd entity. that was stupid.

okay, now I have this malloc'd entity which should work fine and be all happy and stuff... but I don't see where I get to free it... that bad.

since the send just goes off in its own little world, umm, er....? :meep:

[back from fiddling with code]
now that I've got my buf malloc'd I'm getting "out of memory" errors...

The oom's appear to be when I try to send the malloc'd buffer...
*arOut << buf << "\n"; // arOut is a CArchive wrapped around a CSocketFile, which was made from the CSocket...

trying to just do *socket->Send(buf,strlen(buf)) gives me an "access violation".

hell, I just don't know. I just don't know.
Subscribe

  • feedback loops

    Ah, feedback loops. I was kind of out of sorts, yesterday, and for some reason had a lot of diet coke (to try to feel better, though I "knew" it…

  • What would I say?

    What would I say, if I were here? It's 2014, almost 2015—though on and off this year, I've been sure it was 2015. Something about that number. Next…

  • a list of games....

    A friend recently asked for a list of all the games I have available. And I'd made most of this list up a week ago, for someone else, and figured,…

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments