Hey, I just got my first network program working, and what it basically does is one program is the server, another is a client, and you load up the server, and it waits till the client is started on the other computer and has connected

once this happens, the client repeatedly sends a structure that contains all the data for the mouse, and the server receives that every frame (or tries to). Ok, once it receives that data, it then proceeds to draw a box on the screen, one at the server's mouse position, another at the clients mouse position, so you now have two boxes being drawn on the screen and moving around *yay*

but besides the point........

i was wondering, i'm using send recv to send and receive the data, and i'm just sending a 16 byte structure which holds all the mouse data. Now, some things i need to get clarified:

it seems to me, but i can't tell, that the send and receive functions work instantaneously, as long as the server IS connect. However, i was wondering if there was a faster way to update data? is there a faster send receive function? cuz currently the other client's mouse gets updated slower than the server's mouse (of course) and it looks quite choppy..... here's the code for each respective thing:

server:
Code:
bool DrawScene()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glLoadIdentity();
	glTranslated(mouse.X,mouse.Y,0);

	glBegin(GL_QUADS);
		glVertex2d(-5, 5);
		glVertex2d( 5, 5);
		glVertex2d( 5,-5);
		glVertex2d(-5,-5);
	glEnd();

	glEnable(GL_TEXTURE_2D);
	main.glPrint(0,0,"%d",winSockServer.ReceiveData(&receivedMouse,sizeof(receivedMouse)));
	main.glPrint(32,0,"%d %d %d",receivedMouse.L,receivedMouse.R,receivedMouse.M);
	main.glPrint(64,0,"%f",fps.Get());
	glDisable(GL_TEXTURE_2D);

	glLoadIdentity();
	glTranslated(receivedMouse.X,receivedMouse.Y,0);

	glBegin(GL_QUADS);
		glVertex2d(-5, 5);
		glVertex2d( 5, 5);
		glVertex2d( 5,-5);
		glVertex2d(-5,-5);
	glEnd();

	return true;
}
client
Code:
bool DrawScene()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glLoadIdentity();
	glTranslated(mouse.X,mouse.Y,0);

	glBegin(GL_QUADS);
		glVertex2d(-5, 5);
		glVertex2d( 5, 5);
		glVertex2d( 5,-5);
		glVertex2d(-5,-5);
	glEnd();

	glEnable(GL_TEXTURE_2D);
	main.glPrint(0,0,"%d",Client.SendData(&mouse,sizeof(mouse)));
	glDisable(GL_TEXTURE_2D);

	return true;
}
and that seems to work fine (i made my own custom server/client classes, that's what Client.<yadda> is and also winSockServer.<yadda>)

well, just wondering if there's a way to optimize this at all, if not, i'm fine with the way it is right now, because it seems to work VERY nicely