You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TdsParser.ReliabilitySection.Assert("unreliable call to WriteByteArray");// you need to setup for a thread abort somewhere before you call this method
870
-
871
-
boolasync=_parser._asyncWrite;// NOTE: We are capturing this now for the assert after the Task is returned, since WritePacket will turn off async if there is an exception
872
-
Debug.Assert(async ||_asyncWriteCount==0);
873
-
// Do we have to send out in packet size chunks, or can we rely on netlib layer to break it up?
874
-
// would prefer to do something like:
875
-
//
876
-
// if (len > what we have room for || len > out buf)
877
-
// flush buffer
878
-
// UnsafeNativeMethods.Write(b)
879
-
//
880
-
881
-
intoffset= offsetBuffer;
882
-
883
-
Debug.Assert(b.Length>=len,"Invalid length sent to WriteBytes()!");
884
-
885
-
// loop through and write the entire array
886
-
do
887
-
{
888
-
if((_outBytesUsed+len)>_outBuff.Length)
889
-
{
890
-
// If the remainder of the data won't fit into the buffer, then we have to put
891
-
// whatever we can into the buffer, and flush that so we can then put more into
TdsParser.ReliabilitySection.Assert("unreliable call to WriteByteArray");// you need to setup for a thread abort somewhere before you call this method
959
-
960
-
boolasync=_parser._asyncWrite;// NOTE: We are capturing this now for the assert after the Task is returned, since WritePacket will turn off async if there is an exception
961
-
Debug.Assert(async ||_asyncWriteCount==0);
962
-
// Do we have to send out in packet size chunks, or can we rely on netlib layer to break it up?
963
-
// would prefer to do something like:
964
-
//
965
-
// if (len > what we have room for || len > out buf)
966
-
// flush buffer
967
-
// UnsafeNativeMethods.Write(b)
968
-
//
969
-
970
-
intoffset= offsetBuffer;
971
-
972
-
Debug.Assert(b.Length>=len,"Invalid length sent to WriteBytes()!");
973
-
974
-
// loop through and write the entire array
975
-
do
976
-
{
977
-
if((_outBytesUsed+len)>_outBuff.Length)
978
-
{
979
-
// If the remainder of the data won't fit into the buffer, then we have to put
980
-
// whatever we can into the buffer, and flush that so we can then put more into
0 commit comments