OpenersNotesSection(Spacer1)Details

s and d should be distinct.

s must be a loopback link, while d may be a loopback link or an ordinary link.

WSTransferToEndOfLoopbackLink() returns 0 in the event of an error, and a nonzero value if the function succeeds.

WSTransferToEndOfLoopbackLink() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

/* build up an expression on a loopback link and send that expression to a second link */

void f(WSLINK lp1, WSLINK lp2)
{
	if(! WSPutFunction(lp1, "EvaluatePacket", 1))
		{ /* unable to put the function to lp1 */ }

	if(! WSPutFunction(lp1, "ToExpression", 1))
		{ /* unable to put the function to lp1 */ }

	if(! WSPutString(lp1, "a = Table[Random[Integer, 11],{12}];", 36))
		{ /* unable to put the string to lp1 */ }

	if(! WSEndPacket(lp1))
		{ /* unable to send the end-of-packet indicator to lp1 */ }

	if(! WSFlush(lp1))
		{ /* unable to flush any outgoing data buffered in lp1 */ }

	if(! WSTransferToEndOfLoopbackLink(lp2, lp1))
		{ /* unable to transfer all the data from lp1 to lp2 */ }
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSTransferExpression(), paclet:ref/c/WSTransferExpression])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Expressions, paclet:guide/WSTPCFunctionsForExchangingExpressions])}})}})