Saturday, August 22, 2009

Hi tenouk Creator,

http://www.tenouk.com/ is the best site for programmers all around the globe.

Today I found this site.. Very very helpful... Thank you and your team
for doing all the good work..

Content of site is one of the best. If possible we can make the webpages
much better. Similar to cpluscodesnippetnew forum.

Please keep in touch , let me know if i can be of any help.

Thanks
xxxxxxxxx

--
"Programmers never die,they just get lost in processing"

Tuesday, June 30, 2009

Hi,

I detected an error in www.tenouk.com/Winsock/Winsock2example7.html.

with the gethostbyname() and gethostbyaddr() Program Example

it should add

#include ctype.h (put the less than and greater than sign as usual)

at the first of all, doesn't it?

otherwise the compiler will report isalpha function doesn't declared.


Regards.

Saturday, May 16, 2009

Hello,

thank you for providing the winsock tutorials!
Verbose and easy to understand!

When experimenting with the overlapped model sample,
(http://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancediomethod5e.html)
an invalid parameter error occured with WSAWaitForMultipleEvents:
DWORD WINAPI ProcessIO(LPVOID lpParameter)
{
.....
if ((Index = WSAWaitForMultipleEvents(EventTotal, EventArray, FALSE,
WSA_INFINITE, FALSE)) == WSA_WAIT_FAILED)

The invalid parameter was EventTotal == 0, and not == 1 as expected.
To fix the bug you must set EventTotal = 1 *before* you create the
thread for ProcessIO:


if ((EventArray[0] = WSACreateEvent()) == WSA_INVALID_EVENT)

{

printf("WSACreateEvent() failed with error %d\n", WSAGetLastError());

return 1;

}

else

printf("WSACreateEvent() is OK!\n");

////////// ==> fix: set EventTotal = 1 here:
EventTotal = 1;


// Create a thread to service overlapped requests

if (CreateThread(NULL, 0, ProcessIO, NULL, 0, &ThreadId) == NULL)

{

printf("CreateThread() failed with error %d\n", GetLastError());

return 1;

}

else

printf("Nothing to say, CreateThread() is OK!\n");


////////// ==> too late here, ProcessIO() could run already:
// EventTotal = 1;

Thursday, April 16, 2009

Start, the intro

Please use this place to say something, comment (good or bad) and anything else related to tenouk.com. This blog is alternatively monitored by contributors to tenouk.com. TQ.