.NET doc is not clear about this. The NetworkStream.EndWrite returns void which seems to indicate that when this call completes, all the requested bytes will have been written to the other end. Further investigation gave me this data: - NetworkStream.BeginWrite simply calls Socket.BeginSend. - Socket.BeginSend calls WSASocket with async mode. It looks to me then that it's possible that NetworkStream Begin/End Write returns less than requested in that case I'll have to code it such that the rest of the bytes will be sent. Note: NetworkStream.Write (the sync version) does send the whole things before returning. Internally it calls 'send' with blocking mode. The issue here is the async version. Could someone tell me the actual behavior of this call ? Currently I call NetworkStream.BeginWrite only once and assume the entire bytes will be sent. I need to know if I need to loop it or not. Thx. =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com