Hello.
I'm trying to make an IRC client in VC++ 6. I compiled
ircu with cygwin and is running under Win Me. My
client works perfectly on it but when I connect it to
undernet it quits when receives the PING message from
the server. This the function which sends PONG when
receives ping:
void CSockDlg::do_pong(char *rec)
{
char pong_str[] = "\nPONG :";
char *token,*p;
int r;
p = strstr(rec,"PING :");
r = p - rec + 1;
if ( p && (r == 1) )
{
token = strtok(rec,":");
while( token != NULL )
{
if(stricmp(token,"PING ")==0)
{
token = strtok( NULL, "\0");
strcat(pong_str,token);
m_sConnectSocket.Send(pong_str,strlen(pong_str));
}
token = strtok( NULL, " ");
}
}
}
-- where *rec is "ping :<number>"
There is a strange thing... it is keep running after
getting the ping (when connecting). When connected and
receives PING it quits.
Please help me if you can. 10x a lot
JL`
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com