Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReceiveCommandResponse()

ResponseDescription System.Net.CommandStream.ReceiveCommandResponse ( )
inlineprivateinherited

Definition at line 429 of file CommandStream.cs.

430 {
431 ReceiveState receiveState = new ReceiveState(this);
432 try
433 {
434 if (_buffer.Length > 0)
435 {
436 ReceiveCommandResponseCallback(receiveState, -1);
437 }
438 else
439 {
440 try
441 {
442 if (_isAsync)
443 {
444 BeginRead(receiveState.Buffer, 0, receiveState.Buffer.Length, s_readCallbackDelegate, receiveState);
445 return null;
446 }
447 int num = Read(receiveState.Buffer, 0, receiveState.Buffer.Length);
448 if (num == 0)
449 {
450 CloseSocket();
451 }
452 ReceiveCommandResponseCallback(receiveState, num);
453 }
454 catch (IOException)
455 {
457 throw;
458 }
459 catch
460 {
461 throw;
462 }
463 }
464 }
465 catch (Exception ex2)
466 {
467 if (ex2 is WebException)
468 {
469 throw;
470 }
472 }
473 return receiveState.Resp;
474 }
void ReceiveCommandResponseCallback(ReceiveState state, int bytesRead)
static readonly AsyncCallback s_readCallbackDelegate
Exception GenerateException(string message, WebExceptionStatus status, Exception innerException)
override IAsyncResult BeginRead(byte[] buffer, int offset, int size, AsyncCallback callback, object state)
static string net_ftp_receivefailure
Definition SR.cs:106
Definition SR.cs:7

References System.Net.CommandStream._buffer, System.Net.CommandStream._isAsync, System.Net.NetworkStreamWrapper.BeginRead(), System.Net.ReceiveState.Buffer, System.Net.NetworkStreamWrapper.CloseSocket(), System.Net.CommandStream.GenerateException(), System.Net.CommandStream.MarkAsRecoverableFailure(), System.SR.net_ftp_receivefailure, System.IO.Read, System.Net.CommandStream.ReceiveCommandResponseCallback(), System.Net.ReceiveState.Resp, and System.Net.CommandStream.s_readCallbackDelegate.

Referenced by System.Net.CommandStream.PostSendCommandProcessing().