NetBurner 3.5.0
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.
 
void * GetExtraData (int fd)
 Returns the extra structure value from IoExpandStruct associated with the file descriptor.
 
void FreeExtraFd (int fd)
 Free a file descriptor and associated resources.
 
int GetFreeExtraFDCount ()
 Returns the number of free file descriptors.
 
int GetFreeSocketCount (void)
 Returns the number of free sockets.
 

Detailed Description

#include< iointernal.h >

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)

#include <iointernal.h>

Free a file descriptor and associated resources.

Parameters
fdFile descriptor

◆ GetExtraData()

void * GetExtraData ( int fd)

#include <iointernal.h>

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 )

#include <iointernal.h>

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 ( )

#include <iointernal.h>

Returns the number of free file descriptors.

Return values
Numberof free extra file descriptors

◆ GetFreeSocketCount()

int GetFreeSocketCount ( void )

#include <iointernal.h>

Returns the number of free sockets.

Return values
Numberof free sockets