wodSFTP API library - Hostname Property
      
 

Description

Determines the Hostname of remote server.


Return type

A Long value. If successful, 0 is returned, otherwise error as specified here.  


Syntax

long Sftp_GetHostname(void *Sftp, char *Buffer, int *Bufsize);
long Sftp_SetHostname(void *Sftp, char *newVal);

The Hostname function syntax has these parts:

Part Description
void *Sftp Handle of the created Sftp instance.
char *Buffer Buffer that will hold the returned string. Represents the hostname or IP address of the server.
int *Bufsize Size of the buffer.

Remarks

Prior to issuing the Connect method, you should set the Hostname property to the name of the remote server, or its IP address. wodSFTP will resolve the supplied string and use the resultant value when the Connect method is called.

Resolution of the hostname can take a few seconds and its behaviour will depend on your operating system. It is possible that the component will freeze during this time because name resolution is a blocking call. There is nothing wodSFTP can do internally to prevent it from happening.

The Bufsize variable should contain the maximum length of data that can be stored in Buffer variable. If you set Bufsize = 0, then the function will return with error ERROR_INSUFFICIENT_BUFFER and Bufsize will contain the required buffer size.