Method: RubySMB::Client#echo

Defined in:
lib/ruby_smb/client.rb

#echo(count: 1, data: '') ⇒ WindowsError::ErrorCode

Sends an Echo request to the server and returns the NTStatus of the last response packet received.

Parameters:

  • echo (Integer)

    the number of times the server should echo (ignored in SMB2)

  • data (String) (defaults to: '')

    the data the server should echo back (ignored in SMB2)

Returns:

  • (WindowsError::ErrorCode)

    the NTStatus of the last response received



243
244
245
246
247
248
249
250
# File 'lib/ruby_smb/client.rb', line 243

def echo(count: 1, data: '')
  response = if smb2
               smb2_echo
             else
               smb1_echo(count: count, data: data)
             end
  response.status_code
end