SNMP Manager Programmer's Guide

Programming Examples
SNMP Manager Programmer’s Guide–134249
2-30
Managers Supporting UDP and IPC
} else
{
/* Using local access (file) */
fprintf(stdout,
"AWAITIOX for WRITEX returned error %i.\n", err);
}
}
}
return WRITE_FAILED;
}
EBufferReset(ebuffp); /* Reset the buffer to a known state */ <--43
EBufferReset(&myEBuff); /* Reset the buffer to a known state */
/* Receive the response into ebuffp->start_bp */
if(host_int->local_flag == REMOTE_HOSTNAME) <--44
{
/* Using remote access (sockets) */
/* First, get the amount of data written in the t_sendto_nw call */
/* The AWAITIOX call returns 0 as the count transferred! */
host_int->count_written = socket_get_len(host_int->file_num);
if (err = t_recvfrom_nw(host_int->file_num,
(struct sendto_recvfrom_buf*) ebuffp->start_bp,
ebuffp->remaining, 0, IO_tag ) == -1)
{
fprintf(stdout, "T_RECVFROM_NW returned error %i\n.", err);
return READ_FAILED;
}
} else <--45
{
/* Using local access (file) */
status = READX (host_int->file_num, ebuffp->start_bp,
ebuffp->remaining);
if (status != CCE)
{
FILE_GETINFO_ (host_int->file_num, &err);
host_int->err_num = err; /* Save the error number */
Example 2-2. Contents of snmpfsc (page 17 of 19)