public virtual void BeginWrite(int seq)
{
if (wlock.IsHeldByCurrentThread ()) {
throw new IOException ("BeginWrite is not reentrant");
}
#if AGNOS_TRANSPORT_DEBUG
System.Console.WriteLine("Transport.BeginWrite");
#endif
wlock.Acquire ();
wseq = seq;
wbuffer.Position = 0;
wbuffer.SetLength (0);
#if AGNOS_TRANSPORT_DEBUG
System.Console.WriteLine(">> okay");
#endif
}