tfStopTreckMultipleContext

Jump to: navigation, search

Table of Contents >> Stopping the Treck Stack


#include <trsocket.h>


int tfStopTreckMultipleContext (void);


Function Description

Stop the Treck Stack for all contexts. This function is used in multiple context mode (when TM_MULTIPLE_CONTEXT is defined) to stop and uninitialize the Treck protocol stack. This includes:

  • Freeing counting semaphores making sure that none is in use.
  • Closing all interfaces immediately, i.e. no PPP close down, no DHCPv6 close down, etcetera. Only the device driver close routine(s) will be called.
  • Closing/resetting all sockets
  • Killing/freeing all timers
  • Identifing permanently allocated memory (such as DHCP buffers, counting semaphores, select pend entries, interfaces, etc..) and freeing it.
  • Calling tfFreeDynamicMemory() to purge all recycled memory.
  • Making sure there is no more context Treck stack allocated memory before freeing the context


Returns

  • TM_ENOERROR
    Success.
  • TM_EPERM
    Failed to stop one or more contexts.


Limitations

  • These functions cannot be called while a user function is pending in the Treck stack
  • The user should stop all the Treck servers (i.e. tfHttpdUserStop(), tfFtpdUserStop(), etc..) before calling this function.
  • The user should stop all the Treck clients (i.e. tfFtpFreeSession(), tfHttpcUserClose() etc..) before calling this function.
  • The user should guarantee that no Treck function will be called for that context.
  • If the user wants a clean close down of the interfaces, the user should close the interfaces first before calling this function.


Table of Contents >> Stopping the Treck Stack