Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
The General
@
Quackster:
Is your source code anywhere publicly available? I would love to see all the memory leaks you're creating! (No jk, just want to give some feedback)
Source isn't available, yet.
Quote:
Originally Posted by
The General
Also, why Visual C++??? I mean out of everything you could've picked you pick THAT.
I'm using Visual Studio because that was the first thing I had. Moving to CLion later if I can figure out how to fix a problem where stopping the debug doesn't actually close the process.
There's nothing wrong with Visual Studio, so don't push your opinion on to me.
Quote:
Originally Posted by
The General
PS: Avoid this-> all together in C++. Except when you're having ambiousity (Or however you write it) or have to pass a pointer to a function. Its cluttering and the majority of the C++ community avoids this as much as possible. Use naming conventions.
No.
Quote:
Originally Posted by
The General
Also you have atleast 2 memory leaks in your Request class.
No. I don't. I tested this over and over again and I don't.
Quote:
Originally Posted by
The General
Also you read a short but return it as an int. Int is platform depended and may not always be equally sized as a short. (My suggestion don't use int at all but use long (Or even better use int<bitsize>_t eg int32_t)
Shouldn't be a problem because I'm converting shorts to integers, not the other way around.
Quote:
Originally Posted by
The General
I don't think you have to cast the chars to unsigned char in readShort. (1: They keep their bit pattern anyways, 2: you already read from an char*)
I do, otherwise the outcomes are different.
Quote:
Originally Posted by
The General
I wish you luck, because you will need it.
You're the one who needs luck around here, you seem to assume that I didn't put things the way I did for a reason.
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
Quackster
Don't know.
Java > Python > C++
3 times.
After 3 comes 4.
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
iExit
After 3 comes 4.
Right, but this is the second time I've changed languages, third time I've started over. How is that hard to understand?
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
Quackster
Right, but this is the second time I've changed languages, third time I've started over. How is that hard to understand?
Why its hard to understand that after 3 comes 4? He wrote "... 3rd time. Whats next?" and its obvious 4.
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
Quackster
Source isn't available, yet.
I'm using Visual Studio because that was the first thing I had. Moving to CLion later if I can figure out how to fix a problem where stopping the debug doesn't actually close the process.
There's nothing wrong with Visual Studio, so don't push your opinion on to me.
No.
No. I don't. I tested this over and over again and I don't.
Shouldn't be a problem because I'm converting shorts to integers, not the other way around.
I do, otherwise the outcomes are different.
You're the one who needs luck around here, you seem to assume that I didn't put things the way I did for a reason.
Clion and Visual C++? Goodluck with that because CLion uses CMake and visual C++ has its own buildtools.
Memory leak 1 is in your constructor, you take a char* but you will never delete it.
Memory leak 2 is in your read string method. You return a char* but you will never delete it. If you call new you have to delete it at some point.
I assume you didnt run your program using Valgrind or something.
Should upload the sources to github or send me a copy through PM. I want to help you with feedback Alex, not shoot you down.
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
According to @The General "Memory leak 2" return a smart pointer instead of a raw one. And maybe delete the "full_message" in the deconstructor?
After all good luck with your C++ server! :-)
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
Boraida
According to @
The General "Memory leak 2" return a smart pointer instead of a raw one. And maybe delete the "full_message" in the deconstructor?
After all good luck with your C++ server! :-)
The fact that this is already in one class makes me worry what other inventive things he will eventually code...
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Btw checkout Boost.Asio. It's awesome and it supports cross-platform networking.
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
*tik tik tik tik* ... (when will it go boem?)
http://i.imgur.com/GswqHS8.png
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
The General
Because the reason they picked python for it is because they can easily without too much hassle make it distributed. Something which is also possible in C++ but is a bit more difficult to implement and maintain.
Its also the reason why a lot of these services (reddit, paypal, google) moved from Java to Python. The JMS is just slower and it was easier to move to Python.
What..? I didn't mention C++, or Java. You need to learn basic literacy.
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
Boraida
Btw checkout Boost.Asio. It's awesome and it supports cross-platform networking.
Thats what I am using but I am afraid the documentation would be too complicate for him to understand.
(If he manages to somehow install it :lol:
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
Joopie
Fixed.
- - - Updated - - -
Quote:
Originally Posted by
The General
Clion and Visual C++? Goodluck with that because CLion uses CMake and visual C++ has its own buildtools.
Did you even read what I said? Dude.. c'mon I said I'm moving to CLion and Cgywin32 if I can figure out an issue I'm having where if I cancel the debug, the actual process isn't closed.
Quote:
Originally Posted by
The General
Memory leak 1 is in your constructor, you take a char* but you will never delete it.
Actually, since that array was never created with "new" it's been automatically memory allocated, instead of being dynamically allocated (like pointers are) so when the object goes out of the scope, it will be deleted automatically.
Quote:
Originally Posted by
The General
Memory leak 2 is in your read string method. You return a char* but you will never delete it. If you call new you have to delete it at some point.
Using std::string now without any "new" keyword, so once it goes out of the scope it will be automatically freed. :):
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
Quackster
Oh right, thank you sir. :)
Provided Quackster doesn't update the repo or delete the old commits assuming this current version is the very last anyone wanting to directly download the code can do so here:
https://github.com/Habbotard/Icarus-...c358495086.zip
Edit:
On another note, check out D sometime:
Home - D Programming Language
It was started by someone who wrote C++ compilers for years, decided, screw this, C++ has too many limitations because of forced backward compatibility to C (a C++ compiler should be able to compile a C program in other words). He added in nice things like Garbage Collection (optional / modifiable), and it's fully compiled. Look into it when you get sick of C++. Go is only good for the out of the box standard libraries, D is good for OO programming, and other stuff. D is evolving nicely now that it's matured. You can install it with a Visual Studio plugin too.
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
Quackster
Fixed.
Did you even read what I said? Dude.. c'mon I said I'm moving to CLion and Cgywin32 if I can figure out an issue I'm having where if I cancel the debug, the actual process isn't closed.
Actually, since that array was never created with "new" it's been automatically memory allocated, instead of being dynamically allocated (like pointers are) so when the object goes out of the scope, it will be deleted automatically.
Using std::string now without any "new" keyword, so once it goes out of the scope it will be automatically freed. :):
You did not mention Cygwin, which is only a set of linux like tools for windows and provides a linux like API. Also Cygwin isn't really needed, MingW should suffice. (As you only need the GCC compiler).
I don't think you've got any clue what you're doing and probably just following some tutorials on the internet....
Also CLion uses CMake so you need that too.
Re: Icarus Server (Production) - [Python, Multi-DB/MySQL]
Quote:
Originally Posted by
The General
You did not mention Cygwin, which is only a set of linux like tools for windows and provides a linux like API. Also Cygwin isn't really needed, MingW should suffice. (As you only need the GCC compiler).
I don't think you've got any clue what you're doing and probably just following some tutorials on the internet....
Also CLion uses CMake so you need that too.
What else did you think i was going to use if I wanted to make my C++ program cross-compatible and develop it on Windows?
No. MingW _does not_ suffice.
You're free to think whatever you want, but you're the one who assumed that just because you can see a pointer being created, you believe it wasn't being deleted.
I know what CLion uses and doesn't use, stop telling me this.