for getline here's what i wrote, but i still got the same thing.
Code:
int ws_getline(char *str, int maxlen)
{
char *p;
// p= fgets(str,maxlen,ws_fdr);
// if(p == NULL) return(EOF);
// return(strlen(p));
int ret;
ret = recv(ws_sockfd,p,maxlen,0);
str=p;
return ret;
}
return is still -1.
for ws_putline(), i did pretty much what you said, I changed it a little.
Code:
void ws_putline(char *str)
{
//fwrite(str,1,strlen(str),ws_fdw); // writes 23 characters
//fflush(ws_fdw);// returns EOF error. returns -1 value
int n=0;
if (send(ws_sockfd, str, strlen(str), 0) == SOCKET_ERROR)
{
printf("send() failed with error %d\n", WSAGetLastError());
}
else
{
n= send(ws_sockfd, str, strlen(str), 0);
n;
str;
}
}
n is equal to 23 when this is said and done with