Framework EDI Reference. Methods and Properties
ediTransport. EnablePersistentConnection

Enables/Disables persistent connection with the remote server.

Syntax:

Remarks:

Currently applicable to FTP, HTTP and HTTPS only.

Every atomic transaction (send, receive, etc.) made with the remote server always opens a connection, if a connection does not already exist.  By default, the connection persists, and subsequent transactions with the server will use the same connection, provided that all connect configurations remain the same.

To close the connection after every transaction with the server, disable this property by setting it to False.

An existing connection with the remote server will be closed when this object is released or destroyed.

Example

Dim oEdiDoc As Fredi.ediDocument
Dim oTransports As Fredi.ediTransports
Dim oTransport As Fredi.ediTransport

' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument

' Get transports object
Set oTransports = oEdiDoc.GetTransports

' Create single transport object for sending document.
Set oTransport = oTransports.CreateTransport

' Set required parameters for the upload.
oTransport.SetHTTP
oTransport.User = "UserID"
oTransport.Password = "password"
oTransport.Address = "www.somesite.com"
oTransport.TargetPath = "/FREDI_TEST/TestFiles/"

' Disable persistent connection (False), Enable (True).
oTransport.EnablePersistentConnection = False

' IsExist() method opens a connection with remote server, and disconnects
' after the operation because EnablePersistentConnection = False.

oTransport.IsExist "SendTest.Txt"

' NOTE: Disconnected from server at this point.
Debug.Assert oTransport.IsConnected = False

' SendFile() method opens new connect with server, and disconnects
' after the operation because EnablePersistentConnection = FALSE.

oTransport.SendFile App.Path & "\SendTest.Txt"

' NOTE: Disconnected from server at this point.
Debug.Assert oTransport.IsConnected = False

MsgBox "File sent"