| << Prev | appCORE Programming Guide | Next >> |
NAME
coreNetOptionSet() -- set, and configure, the netCORE option.
SYNOPSIS
include "appcore.h"
int coreNetOptionSet(
coreNetOptionSPEC_t* s,
coreNetOption_t o,
void* d,
size_t l )
DESCRIPTION
The coreNetOptionSet() function sets, and configures, the specified netCORE option. The available options are enumerated via the coreNetOption_t data type. This function operates like the standard socket option functions. For options that are simple on-off, no data is required. For options that require configuration data, a pointer to the data and it's length is required. Before a network channel is opened, the user should set all required options.
PARAMETERS
s pointer to the coreNetOptionSPEC_t in the channel specification. o one of the enumerated options. d optional pointer to a data buffer for option configuration l length of option data buffer
Sample Code
// Set receive only channel
coreNetOptionSet(
&Spec,
coreNetOptionDIR_RX,
NULL,
0 );
// Set message processing option
coreNetChanMsgSPEC_t MsgSpec;
bzero( &MsgSpec, sizeof(MsgSpec) );
MsgSpec.HeaderLength = sizeof( YourMsgHeader );
MsgSpec.GetPayloadSize = YourMsgGetPayloadSize;
// Set the option
coreNetOptionSet(
&Options,
coreNetOptionMSG,
&MsgSpec,
sizeof(MsgSpec) );
RETURN VALUE
| errno Value | Condition | ||||||
| EINVAL | specification is NULL | EINVAL | invalid, or unsupported, channel option | EINVAL | option buffer NULL, option buffer length non-zero | EINVAL | option buffer defined, length zero |
MULTI-THREAD SAFETY LEVEL
MT-safe.
SEE ALSO
| << Prev | appCORE Programming Guide | Next >> |