ok, heres my lil dilema, im making an IRC client with wonsock, so far, so good, except i need to return a pong everytime a server sends a ping with a random number... I.E.
server sends << PING 123321
then i send >> PONG 123321
this will enable me to stay connected to the server, now what my problem is, is i forgot how to replace variables. and my C++ book i use as a referance is sorta missing in action, i think i let a friend use it anyways.
right after my
recv(Socket, data, 1024, 0);
i have a strcmp looking for ping, now when it recieves the ping i simply want to change ping to pong set it to a string and send it back.
send(Socket, data, 1024, 0);
thus giving me my automated ping pong event handler... but i forgot how to change ping to pong =/ also, to prevent abuse, how would i make it only send pongs back to the server, because with strcmp some jack ass in a room could just type ping blah a bunch and make me send false pongs to the server most likely getting my client Z:lined for flooding.
thanks in advance.