src/main/java/org/cloudi/API.java
public void return_sync(final String name,
                            final String pattern,
                            byte[] response_info,
                            byte[] response,
                            Integer timeout,
                            final byte[] trans_id,
                            final OtpErlangPid pid)
        throws ReturnSyncException
    {
        try
        {
            OtpOutputStream return_sync = new OtpOutputStream();
            return_sync.write(OtpExternal.versionTag);
            final OtpErlangObject[] tuple = {new OtpErlangAtom("return_sync"),
                                             new OtpErlangString(name),
                                             new OtpErlangString(pattern),
                                             new OtpErlangBinary(response_info),
                                             new OtpErlangBinary(response),
                                             new OtpErlangUInt(timeout),
                                             new OtpErlangBinary(trans_id),
                                             pid};
            return_sync.write_any(new OtpErlangTuple(tuple));
            send(return_sync);
        }
        catch (OtpErlangRangeException e)
        {
            e.printStackTrace(API.err);
            return;
        }
        throw new ReturnSyncException();
    }
public void return_sync(final String name,
                            final String pattern,
                            byte[] response_info,
                            byte[] response,
                            Integer timeout,
                            final byte[] trans_id,
                            final OtpErlangPid pid)
        throws ReturnSyncException
    {
        try
        {
            OtpOutputStream return_sync = new OtpOutputStream();
            return_sync.write(OtpExternal.versionTag);
            final OtpErlangObject[] tuple = {new OtpErlangAtom("return_sync"),
                                             new OtpErlangString(name),
                                             new OtpErlangString(pattern),
                                             new OtpErlangBinary(response_info),
                                             new OtpErlangBinary(response),
                                             new OtpErlangUInt(timeout),
                                             new OtpErlangBinary(trans_id),
                                             pid};
            return_sync.write_any(new OtpErlangTuple(tuple));
            send(return_sync);
        }
        catch (OtpErlangRangeException e)
        {
            e.printStackTrace(API.err);
            return;
        }
        throw new ReturnSyncException();
    }
Synchronously returns a response from a service request.

@param name           the service name
@param pattern        the service name pattern
@param response_info  any response metadata
@param response       the response data
@param timeout        the request timeout in milliseconds
@param trans_id       the transaction ID
@param pid            the request's source process ID

@throws ReturnSyncException sync service request returned