int writecnta(int &sock,char *buf)
{
int length;
int wlength;
int tmpLength;
tmpLength=0;
length=strlen(buf);
while(tmpLength != length)
{
wlength=write(sock,&buf[tmpLength],length-tmpLength);
if(wlength < 0)
{
if( errno == EINTR )
{
wlength=0;
}
else
{
close(sock);
return 1;
}
}
else
{
tmpLength+=wlength;
}
}
return 0;
}
{
int length;
int wlength;
int tmpLength;
tmpLength=0;
length=strlen(buf);
while(tmpLength != length)
{
wlength=write(sock,&buf[tmpLength],length-tmpLength);
if(wlength < 0)
{
if( errno == EINTR )
{
wlength=0;
}
else
{
close(sock);
return 1;
}
}
else
{
tmpLength+=wlength;
}
}
return 0;
}