Thread: Socket Server
View Single Post
Old May 22nd, 2006, 6:21 PM   #12
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
I would either use the windows messages or create a thread. I find creating threads causes more lag than I want so I usually go with windows messages.

EDIT: I suggest removing those extra functions that are un-needed.

void Mysocket::WinConnect()
{
WSADATA w;
	if (WSAStartup(0x0101, &w) != 0)
		{
			cout<< "ERROR: Could Not Open Windows connection."<<endl;
			exit(0);
		}

}
This is just a waste of space. WinConnect is called inside the constructor, and you will never have to use WinConnect() in your code so why even create a function for it? Same goes for your close() function. They just help clutter up your code.
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it.

Download Code::Blocks now!
jayme is offline   Reply With Quote