.NET/Link API Version 1.5 USE FRAMES

IMathLink.NewPacket Method 

Discards the current packet, if it has been partially read. Has no effect if the previous packet was fully read.

[Visual Basic]
Sub NewPacket()
[C#]
void NewPacket();

Remarks

This is a useful cleanup function. You can call it when you are finished examining the contents of a packet that was opened with NextPacket or WaitAndDiscardAnswer, whether you have read the entire packet contents or not. You can be sure that the link is then in a state where you are ready to read the next packet.

It is also frequently used in a catch block for a MathLinkException, to clear off any unread data in a packet before returning to the normal program flow.

See Also

IMathLink Interface | Wolfram.NETLink Namespace | NextPacket