Beispiel #1
0
 public Task Close(CloseOpt closeOpt)
 {
     if (closeOpt.CloseType == CloseType.Close)
     {
         Shutdown(SocketShutdown.Both);
     }
     else
     {
         Shutdown(closeOpt.ShutdownType);
     }
     return(NaiveUtils.CompletedTask);
 }
Beispiel #2
0
 public Task Close(CloseOpt closeOpt)
 {
     if (closeOpt.CloseType == CloseType.Close)
     {
         return(BaseStream.Close());
     }
     else if (closeOpt.CloseType == CloseType.Shutdown)
     {
         return(BaseStream.Shutdown(closeOpt.ShutdownType));
     }
     else
     {
         throw new ArgumentOutOfRangeException(nameof(closeOpt));
     }
 }
Beispiel #3
0
 public Task Close(CloseOpt closeOpt)
 {
     Task[] tasks = allStreams.Select(x => x.Close(closeOpt)).ToArray();
     return(Task.WhenAll(tasks));
 }
Beispiel #4
0
 public Task Close(CloseOpt closeOpt)
 {
     throw new NotImplementedException();
 }