title: Teradata and Java server Connection
body: <p>I am trying to connect to JAVA server using Teradata UDF, here is my code below.It uses HOST as "localhost" and PORT(integer) as "9091" and all the parameters such as PEM file location etc have been provided, but the function always exits from the catch block.I know that <code>exit(0)</code> is not allowed in Teradata UDF's, I have used it just for the sake of debugging.The same code connects to the server absolutely fine in case ORACLE UDF. Please tell which ports can be used for communication in case of Teradata, or whether an SSL connection to server is even supported in Teradata.
  The server accepts argument of type request and returns result ,both of type <code>vector &lt;struct&gt;</code>.</p>
  
  <pre><code>  Response CplusplusClient::startClient(DeTokenizationRequest request) {
    boost::shared_ptr&lt;TSSLSocketFactory&gt; factory(new TSSLSocketFactory());
    factory-&gt;loadPrivateKey(PRIVATE_KEY.c_str());
    factory-&gt;loadCertificate(CERTIFICATE.c_str());
    factory-&gt;loadTrustedCertificates(TRUSTED_CERTIFICATE.c_str());
    factory-&gt;authenticate(true);
    boost::shared_ptr&lt;TSSLSocket&gt; socket = factory-&gt;createSocket(HOST,PORT);
  
    boost::shared_ptr&lt;TTransport&gt; transport(new TBufferedTransport(socket));
    boost::shared_ptr&lt;TProtocol&gt; protocol(new TBinaryProtocol(transport));
    XSecurityServiceClient client(protocol);
  
    Response result;
  
   try {
      transport-&gt;open();
      client.requested(result, request);
      transport-&gt;close();
    } catch (TException&amp; tx) {
      exit(0);
    }
    return result;
  }
  }
  </code></pre>