Hi,
I am very new in socket programing on Unix. The problem is that it seems that send function is not setting a errno on Solaris machine or I got it wrong.
well I have
...
trace("DEBUG 0 Number of bytes returned :%d", errno);
begin = 0
while (send_len > (cur_sent = send(sock,&((char *)msg)[begin],send_len,0)))
{
trace("DEBUG 1 Number of bytes returned :%d, errno = %d",cur_sent, errno);
if ((0 > cur_sent) && ((errno != EWOULDBLOCK) &&
(errno != EAGAIN) &&
(errno != EINTR)))
{ /* check why nothing has been sent */
free(msg);
mERR_SOCKET("send",ctl_tbl[sock]->service,errno);
SYSpop();
return(AMSA02_CP_ERR);
}
if (0 > cur_sent {
cur_sent = 0;
}
send_len -= cur_sent; /* determine new length to send */
begin += cur_sent; /* determine new index of data to send */
}
Well.. And so in code above I had such a problem that send() returned -1 (only when machine had very high load) and errno was still 0. How it can happen ? , Wll I have tried to explicitly set errno to some non zero value before send() is called and anyway successful send doesnot resets errno to 0.
Please anybody can give me a hint ?
ToNy
I am very new in socket programing on Unix. The problem is that it seems that send function is not setting a errno on Solaris machine or I got it wrong.
well I have
...
trace("DEBUG 0 Number of bytes returned :%d", errno);
begin = 0
while (send_len > (cur_sent = send(sock,&((char *)msg)[begin],send_len,0)))
{
trace("DEBUG 1 Number of bytes returned :%d, errno = %d",cur_sent, errno);
if ((0 > cur_sent) && ((errno != EWOULDBLOCK) &&
(errno != EAGAIN) &&
(errno != EINTR)))
{ /* check why nothing has been sent */
free(msg);
mERR_SOCKET("send",ctl_tbl[sock]->service,errno);
SYSpop();
return(AMSA02_CP_ERR);
}
if (0 > cur_sent {
cur_sent = 0;
}
send_len -= cur_sent; /* determine new length to send */
begin += cur_sent; /* determine new index of data to send */
}
Well.. And so in code above I had such a problem that send() returned -1 (only when machine had very high load) and errno was still 0. How it can happen ? , Wll I have tried to explicitly set errno to some non zero value before send() is called and anyway successful send doesnot resets errno to 0.
Please anybody can give me a hint ?
ToNy