|
XSocket API
2.0
XIA Socket Library
|
#include <errno.h>#include "Xsocket.h"#include "Xinit.h"#include "Xutil.h"#include "dagaddr.hpp"Functions | |
| int | XupdateDefaultInterface (int sockfd, int interface) |
| Change the default interface for this host. More... | |
| int | XdefaultInterface (int sockfd) |
| Identify the default interface for this system. More... | |
| int XdefaultInterface | ( | int | sockfd | ) |
An application can call XdefaultInterface() to identify the network interface that is the default interface for this system.
| sockfd | an Xsocket previously created. |
| int XupdateDefaultInterface | ( | int | sockfd, |
| int | interface | ||
| ) |
The XupdateDefaultInterface allows an application to change the default interface used by the system. The address accociated with the default interface is used as source address in outgoing packets. The response packets from a peer would then arrive on the default interface for all applications unless they choose to bind to another interface.
Note that this API changes the default interface for the system and will be a protected API in the future.
If an application needs to just change the source address for itself and not the entire system, it should bind() to an address associated with the intented interface and not use this API.
| sockfd | an Xsocket previously created. |
| interface | the new default interface. |
1.8.11