Most of the above post is incorrect, I suggest both posters read Section 4.4 of the HTTP 1.1 RFC.
Type: Posts; User: azteched
Most of the above post is incorrect, I suggest both posters read Section 4.4 of the HTTP 1.1 RFC.
Do you create your threads detached or not detached?
It actually tells you how many bytes were available up to the time ioctlsocket returns - it doesn't make any guarantees about the availability of data later.
Yes, but each time you call recv, it's important to check the return value, as that will be the number of bytes actually written to your buffer.
Some do say that (personally I think it's stupid to restrict yourself like that, it all depends on the situation), but in the presence of exceptions, there can't be one exit point. RAII/scoped...
Yep. (N.b. I use the term mutex to refer to CRIT_SECT because it's in line with pthreads terminology).
You could pass a pointer to a struct containing all the data required for the thread,...
Executing the same code is fine, it's modifying shared data that you need to protect. Th fact you thought otherwise leads me to believe you need to learn a bit more about threading and...
Or use boost
#include <boost/lexical_cast.hpp>
double MyDouble = 1.602;
std::string MyStr = boost::lexical_cast<string> (MyDouble);
To the first question:
You don't need external synchronization just to send() and recv() in multiple threads on the same socket, but you'll likely sync. some at some point.
VC2005 beta doesn't come with the platform SDK, you need to download it separately, and then add the include directories in the platform SDK to VC2005 in Options.
Sorry -
WSAEventSelect
GetQueuedCompletionStatus with CreateIOCompletionPort
Standard blocking sockets in multiple threads is async too, because threads are async by definition.
MSDN basically explains how to use them..
Only WSAAsyncSelect requires the windows program stuff (i.e. a window procedure and message pump). Other async. methods don't.
Are you forwarding the relevant port(s) on your router?
You need to compile your code on some kind of unix system - Windows/MS compiler don't do fork().
Templates can be considered as "compile time polymorphism" - they let you write the same code against multiple types. I think it's also known as "parametric polymorphism" (?).
Make the socket non-blocking?
When using non-blocking sockets, you'd monitor via select() or whatever, because there's no point in looping waiting for send() not to fail with EWOULDBLOCK.
Well that's why I posted; there isn't anything I can see from the docs that does what I want. It's pretty trivial to implement, but I was suprised there's no "relative_to" function in the library.
I have some path (Folder) that I'm searching:
for (directory_iterator It (Folder); It != EndIt; ++It) {
Contents.push_back (*It);
}
Yes, WSAAsyncSelect or other related functions are probably more appropriate for a Windows app.
std::vector isn't allowed to be implemented as a linked list - it's required to have contiguous memory.
Point him to the STL, Boost, and any other template library - they implement their classes in the headers. Putting the implementation in a cpp, then including the cpp is exactly the same thing, but...
Yeh but if you're going to #include cpp files, you may as well stick the whole lot in the header, and have just one file.
Put them inside the #define.
I wouldn't necessarily use "using namespace std" (pulling in the entire std:: namespace) when "using std::vector" would suffice (as here).