Fautore Secure Transport
Fautore Secure Transport is implemented per OSA standards for messaging and encryption. The below code excerpt illustrates establishing a connection from the OCE to a registered application:
use Fautore::Socket; # Connect my $DomOrIP = "TekAdvocates.com"; # either a domain name or an ip address my $TimeOut = 60; # timeout to abort connection in seconds my $Port = 80; # the port to use unless(FPM_Connect_URL($DomOrIP,$Port,$TimeOut,1)) { # connection failed do something?? exit(1); } # now send something my $ToSend = "hello world"; my $BytesRemaining = length($ToSend); my $BytesSent; my $Error = ""; my $SendTimeOut = 5; while($BytesRemaining) { ($BytesSent,$BytesRemaining,$ToSend,$Error) = FPM_SocketWrite($DomOrIP,$ToSend,$SendTimeOut); if ($Error) { # The send has failed FPM_Close_Handle($DomOrIP,0,1); exit(1); } } # perhaps read something???? my $BytesRead = 0; my $BufferSize = 30000; my $ReadData = ""; my $TimeSince = 0; my $LastTime = time; while($DomOrIP) { $BytesRead = FPM_SocketRead($DomOrIP,$BufferSize,\$ReadData); # # Is it closed for reading or disconnected # if ($BytesRead < 0) { FPM_Close_Handle($DomOrIP,0,1); exit(1); } # # Did we read any bytes in # if ($BytesRead == 0) { # # No bytes read in # $TimeSince = time - $LastTime; if ($TimeSince < 2) { select(undef,undef,undef,.1); next; } if ($TimeSince < 15) { sleep(1); next; } FPM_Close_Handle($DomOrIP,0,1); exit(1); } $LastTime = time; # typically here you would check $ReadData for something that signifies # that you have read every thing you need. # knowing a content-length or perhaps some special character(s) # that signify you have read all that you need too is quite vital # Heres an exmaple looking for CR+LF if (index($ReadData,"\x0D\x0A") >= 0) { last; } } # At this point here $ReadData contains what we have just read