@@ -264,24 +264,24 @@ public virtual bool Restart()
264264 /// Multicast datagram to the prepared mulicast endpoint (synchronous)
265265 /// </summary>
266266 /// <param name="buffer">Datagram buffer to multicast</param>
267- /// <returns>'true' if the datagram was successfully multicasted, 'false' if the datagram was not multicasted </returns>
268- public virtual bool Multicast ( byte [ ] buffer ) { return Multicast ( buffer , 0 , buffer . Length ) ; }
267+ /// <returns>Size of multicasted datagram</returns>
268+ public virtual long Multicast ( byte [ ] buffer ) { return Multicast ( buffer , 0 , buffer . Length ) ; }
269269
270270 /// <summary>
271271 /// Multicast datagram to the prepared mulicast endpoint (synchronous)
272272 /// </summary>
273273 /// <param name="buffer">Datagram buffer to multicast</param>
274274 /// <param name="offset">Datagram buffer offset</param>
275275 /// <param name="size">Datagram buffer size</param>
276- /// <returns>'true' if the datagram was successfully multicasted, 'false' if the datagram was not multicasted </returns>
277- public virtual bool Multicast ( byte [ ] buffer , long offset , long size ) { return Send ( MulticastEndpoint , buffer , offset , size ) ; }
276+ /// <returns>Size of multicasted datagram</returns>
277+ public virtual long Multicast ( byte [ ] buffer , long offset , long size ) { return Send ( MulticastEndpoint , buffer , offset , size ) ; }
278278
279279 /// <summary>
280280 /// Multicast text to the prepared mulicast endpoint (synchronous)
281281 /// </summary>
282282 /// <param name="text">Text string to multicast</param>
283- /// <returns>'true' if the text was successfully multicasted, 'false' if the text was not multicasted </returns>
284- public virtual bool Multicast ( string text ) { return Multicast ( Encoding . UTF8 . GetBytes ( text ) ) ; }
283+ /// <returns>Size of multicasted datagram </returns>
284+ public virtual long Multicast ( string text ) { return Multicast ( Encoding . UTF8 . GetBytes ( text ) ) ; }
285285
286286 /// <summary>
287287 /// Multicast datagram to the prepared mulicast endpoint (asynchronous)
@@ -310,32 +310,32 @@ public virtual bool Restart()
310310 /// Send datagram to the connected server (synchronous)
311311 /// </summary>
312312 /// <param name="buffer">Datagram buffer to send</param>
313- /// <returns>'true' if the datagram was successfully sent, 'false' if the datagram was not sent </returns>
314- public virtual bool Send ( byte [ ] buffer ) { return Send ( buffer , 0 , buffer . Length ) ; }
313+ /// <returns>Size of sent datagram</returns>
314+ public virtual long Send ( byte [ ] buffer ) { return Send ( buffer , 0 , buffer . Length ) ; }
315315
316316 /// <summary>
317317 /// Send datagram to the connected server (synchronous)
318318 /// </summary>
319319 /// <param name="buffer">Datagram buffer to send</param>
320320 /// <param name="offset">Datagram buffer offset</param>
321321 /// <param name="size">Datagram buffer size</param>
322- /// <returns>'true' if the datagram was successfully sent, 'false' if the datagram was not sent </returns>
323- public virtual bool Send ( byte [ ] buffer , long offset , long size ) { return Send ( Endpoint , buffer , offset , size ) ; }
322+ /// <returns>Size of sent datagram</returns>
323+ public virtual long Send ( byte [ ] buffer , long offset , long size ) { return Send ( Endpoint , buffer , offset , size ) ; }
324324
325325 /// <summary>
326326 /// Send text to the connected server (synchronous)
327327 /// </summary>
328328 /// <param name="text">Text string to send</param>
329- /// <returns>'true' if the text was successfully sent, 'false' if the text was not sent </returns>
330- public virtual bool Send ( string text ) { return Send ( Encoding . UTF8 . GetBytes ( text ) ) ; }
329+ /// <returns>Size of sent datagram </returns>
330+ public virtual long Send ( string text ) { return Send ( Encoding . UTF8 . GetBytes ( text ) ) ; }
331331
332332 /// <summary>
333333 /// Send datagram to the given endpoint (synchronous)
334334 /// </summary>
335335 /// <param name="endpoint">Endpoint to send</param>
336336 /// <param name="buffer">Datagram buffer to send</param>
337- /// <returns>'true' if the datagram was successfully sent, 'false' if the datagram was not sent </returns>
338- public virtual bool Send ( EndPoint endpoint , byte [ ] buffer ) { return Send ( endpoint , buffer , 0 , buffer . Length ) ; }
337+ /// <returns>Size of sent datagram</returns>
338+ public virtual long Send ( EndPoint endpoint , byte [ ] buffer ) { return Send ( endpoint , buffer , 0 , buffer . Length ) ; }
339339
340340 /// <summary>
341341 /// Send datagram to the given endpoint (synchronous)
@@ -344,14 +344,14 @@ public virtual bool Restart()
344344 /// <param name="buffer">Datagram buffer to send</param>
345345 /// <param name="offset">Datagram buffer offset</param>
346346 /// <param name="size">Datagram buffer size</param>
347- /// <returns>'true' if the datagram was successfully sent, 'false' if the datagram was not sent </returns>
348- public virtual bool Send ( EndPoint endpoint , byte [ ] buffer , long offset , long size )
347+ /// <returns>Size of sent datagram</returns>
348+ public virtual long Send ( EndPoint endpoint , byte [ ] buffer , long offset , long size )
349349 {
350350 if ( ! IsStarted )
351- return false ;
351+ return 0 ;
352352
353353 if ( size == 0 )
354- return true ;
354+ return 0 ;
355355
356356 try
357357 {
@@ -367,13 +367,13 @@ public virtual bool Send(EndPoint endpoint, byte[] buffer, long offset, long siz
367367 OnSent ( endpoint , sent ) ;
368368 }
369369
370- return true ;
370+ return sent ;
371371 }
372- catch ( ObjectDisposedException ) { return false ; }
372+ catch ( ObjectDisposedException ) { return 0 ; }
373373 catch ( SocketException ex )
374374 {
375375 SendError ( ex . SocketErrorCode ) ;
376- return false ;
376+ return 0 ;
377377 }
378378 }
379379
@@ -382,8 +382,8 @@ public virtual bool Send(EndPoint endpoint, byte[] buffer, long offset, long siz
382382 /// </summary>
383383 /// <param name="endpoint">Endpoint to send</param>
384384 /// <param name="text">Text string to send</param>
385- /// <returns>'true' if the text was successfully sent, 'false' if the text was not sent </returns>
386- public virtual bool Send ( EndPoint endpoint , string text ) { return Send ( endpoint , Encoding . UTF8 . GetBytes ( text ) ) ; }
385+ /// <returns>Size of sent datagram </returns>
386+ public virtual long Send ( EndPoint endpoint , string text ) { return Send ( endpoint , Encoding . UTF8 . GetBytes ( text ) ) ; }
387387
388388 /// <summary>
389389 /// Send datagram to the given endpoint (asynchronous)
0 commit comments