I know it's been a while since I last worked on this, but here's version 1.1 of Quick-Sock.
QUICK SOCK CHANGE-LOG ( April, 2013 ):
The 'Socket' class has been renamed to 'QSocket'. If you don't feel like changing the name in your existing code, just use this: "typedef QSocket Socket;"
Quick-Sock now supports Unix sockets, meaning that it runs on Linux, and possibly Mac OS X (I haven't tested it on Mac OS X. Also, WinSock is still used when compiling for Windows).
Several random bugs have been fixed, the most notable bug being the isServer changing bug.
Good enough error checking has been added(See QSOCK_COUT).
QSOCK_COUT finally works the way I wanted it to.
The legal disclaimers have been moved to each file instead of just the headers.
Some commands have been moved to the header. Mostly for public 'inline' functionality.
The 'inline' keyword has been used for some methods and functions, to make execution quicker. Mostly small methods.
The 'readLong' & 'writeLong' methods now use "long long / long long int"(64-bit int), instead of long(Usually 32-bit with 32-bit compilers).
The 'readBytes' & 'writeBytes' methods have been recreated, and now work properly.
Since 'readBytes' and 'writeBytes' have been fixed, 'readLine' and 'writeLine' now work properly.
All 32-bit(IPV4) IP addresses now use 'unsigned long'(unsigned 32/64-bit integer), instead of 'int'(signed 32-bit integer).
All supported integers over 1 byte in size(16-bit, 32-bit, and 64-bit), are now converted properly to 'Big endian', then back into 'Little endian'/the native 'byte' order.
The 'getSocket' command now returns a SOCKET pointer instead of passing a new SOCKET with the same information as '_socket'.
// New functions:
No functions were added.
// New methods:
// Most of these just act as user friendly wrappers, and do not add much in terms of functionality:
std::string readString(unsigned int length=0); // If the length variable is 0, it will use all remaining bytes.
// 'writeString' versions:
bool writeString(std::string str);
bool writeString(const char* str); // The same as 'writeBytes' for now.
bool writeString(const unsigned char* str); // The same as 'UwriteBytes' for now.
// New method overloads:
bool writeLine(std::string str);
bool writestdLine(std::string str); // The same as the std::string overload for 'writeLine' command.
std::string readstdLine();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I know it's been a while since I last worked on this, but here's version 1.1 of Quick-Sock.
QUICK SOCK CHANGE-LOG ( April, 2013 ):
The 'Socket' class has been renamed to 'QSocket'. If you don't feel like changing the name in your existing code, just use this: "typedef QSocket Socket;"
Quick-Sock now supports Unix sockets, meaning that it runs on Linux, and possibly Mac OS X (I haven't tested it on Mac OS X. Also, WinSock is still used when compiling for Windows).
Several random bugs have been fixed, the most notable bug being the isServer changing bug.
Good enough error checking has been added(See QSOCK_COUT).
QSOCK_COUT finally works the way I wanted it to.
The legal disclaimers have been moved to each file instead of just the headers.
Some commands have been moved to the header. Mostly for public 'inline' functionality.
The 'inline' keyword has been used for some methods and functions, to make execution quicker. Mostly small methods.
The 'readLong' & 'writeLong' methods now use "long long / long long int"(64-bit int), instead of long(Usually 32-bit with 32-bit compilers).
The 'readBytes' & 'writeBytes' methods have been recreated, and now work properly.
Since 'readBytes' and 'writeBytes' have been fixed, 'readLine' and 'writeLine' now work properly.
All 32-bit(IPV4) IP addresses now use 'unsigned long'(unsigned 32/64-bit integer), instead of 'int'(signed 32-bit integer).
All supported integers over 1 byte in size(16-bit, 32-bit, and 64-bit), are now converted properly to 'Big endian', then back into 'Little endian'/the native 'byte' order.
The 'getSocket' command now returns a SOCKET pointer instead of passing a new SOCKET with the same information as '_socket'.
// New functions:
// New methods:
// Most of these just act as user friendly wrappers, and do not add much in terms of functionality:
// 'writeString' versions:
// New method overloads:
bool writeLine(std::string str);
bool writestdLine(std::string str); // The same as the std::string overload for 'writeLine' command.
std::string readstdLine();