NetBurner 3.3.9
PDF Version
Extra File Descriptors

Functions

int GetExtraFD (void *extra_data, struct IoExpandStruct *pFuncs)
 Returns a file descriptor for the structure passed as the IoExpandStruct. FreeExtraFd( ) will release the fd back to the pool of available fds. More...
 
void * GetExtraData (int fd)
 Returns the extra structure value from IoExpandStruct associated with the file descriptor. More...
 
void FreeExtraFd (int fd)
 Free a file descriptor and associated resources. More...
 
int GetFreeExtraFDCount ()
 Returns the number of free file descriptors. More...
 

Detailed Description

The NetBurner environment integrates the RTOS, TCP/IP stack, and other peripherals with a file I/O system based on file descriptors. A file descriptor can be described as a handle to a network socket, serial port, system peripheral, or any other object that can be read or written to. Most of the API functions pass a file descriptor as a parameter to such an object. These function are available if you wish to use the file descritpor system capabilities for your own application purposes. Please refer to the File Descriptor section in the Programmers Guide.

Function Documentation

◆ FreeExtraFd()

void FreeExtraFd ( int  fd)

Free a file descriptor and associated resources.

Parameters
fdFile descriptor

◆ GetExtraData()

void * GetExtraData ( int  fd)

Returns the extra structure value from IoExpandStruct associated with the file descriptor.

Parameters
fdFile descriptor
Return values
Valueof the extra member of the structure

◆ GetExtraFD()

int GetExtraFD ( void *  extra_data,
struct IoExpandStruct *  pFuncs 
)

Returns a file descriptor for the structure passed as the IoExpandStruct. FreeExtraFd( ) will release the fd back to the pool of available fds.

Parameters
extra_dataThe optional extra_data void pointer can be used to pass data into the file descriptor
*pFuncsStructure containing callback functions for such things as read, write, close, and the extra_data variable
Return values
Valuegreater than 0, representing the file descriptor on success
-1on failure

◆ GetFreeExtraFDCount()

int GetFreeExtraFDCount ( )

Returns the number of free file descriptors.

Return values
Numberof free extra file descriptors