{===========================================================================================}
{	LlamaTalkCPWrite}
{	}
{	Copyright © 1994 Apple Computer, Inc.}
{	All rights reserved}
{	}
{	Modification Status}
{	YY/MM/DD	Name				Comments}
{	94/09/12	Jim Schram		Added CodeWarrior support, released as 1.0a4}
{	94/05/04	Jim Schram		Released as 1.0a1}
{	94/03/24	Jim Schram		Initial Development}
{	}
{-------------------------------------------------------------------------------------------------------------}
Unit LlamaTalkCPWrite;

Interface

	Uses
		LlamaTalk;

{$MAIN}
	Procedure Main (connHdl: ConnHandle);

Implementation

	Procedure Main (connHdl: ConnHandle);
		Var
			globals: LTGlobalsHdl;
			socket: Short;
	Begin
		globals := LTGlobalsHdl(connHdl^^.refCon);
		socket := connHdl^^.userData;
		With globals^^.fSockets[socket] Do Begin
				fWriteCount := fConnHdl^^.asyncCount[cmDataOut];
				Case fConnHdl^^.errCode Of
					cmNoErr: 
						Case fWritePhase Of
							cLTWritePhase2: 
								fWritePhase := cLTWritePhase3;
							cLTWritePhase4: 
								fWritePhase := cLTWritePhase5;
						End;
					cmNotOpen: 
						fWritePhase := cLTWritePhaseError;
					Otherwise
						fWritePhase := cLTWritePhaseError;
				End;
			End;
	End;

End.