Login  
Search All Forums
Dart Home | PowerTCP Sockets for .NET | Custom Development Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
AuthorForum: PowerTCP Sockets for .NET (Secure and Standard)
Topic: Quick Tcp.Segment question
brunp

From: Ottawa, ON Canada
Posts: 6
Member Since: 04/12/06
posted June 21, 2006 6:48 AM

If you pass a byte array of 1024 into the BeginReceive method. Will the Segment.count size in the EndReceive event give you a cout of less than 1024 if less than 1024 bytes are received?

Kind of an important question.

Regards,
Paul
Amit

From: Rome, NY USA
Posts: 315
Member Since: 03/15/06
posted June 21, 2006 2:15 PM

Hello,

Regarding the query, please note that the e.Segment.Count in the EndReceive Event will always give a count of bytes of data received. In case you have passed a byte array of 1024 into the BeginReceive method and only 1020 bytes have been received, then the following code snippet code will give you a count of 1020:

Private Sub Tcp1_EndReceive(ByVal sender As Object, ByVal e As Dart.PowerTCP.SegmentEventArgs) Handles Tcp1.EndReceive
{
Debug.WriteLine("Byte Count received:" + e.Segment.Count)
}

I hope this will be of help. In case of further assistance/ clarifications, please feel free to write back and I would be glad to assist you.

Have a nice day ahead.

Best Regards,
Amit
Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX