lib/ronin/network/mixins/tcp.rb in ronin-support-0.4.0 vs lib/ronin/network/mixins/tcp.rb in ronin-support-0.4.1
- old
+ new
@@ -82,16 +82,18 @@
# @example
# tcp_connect # => TCPSocket
#
# @example
# tcp_connect do |socket|
- # socket.write("GET /\n\n")
+ # socket.write("GET / HTTP/1.1\n\r\n\r")
#
# puts socket.readlines
# socket.close
# end
#
+ # @see Network::TCP#tcp_connect
+ #
# @api public
#
def tcp_connect(&block)
print_info "Connecting to #{host_port} ..."
@@ -112,10 +114,12 @@
# The newly created TCPSocket object.
#
# @return [TCPSocket]
# The newly created TCPSocket object.
#
+ # @see Network::TCP#tcp_connect_and_send
+ #
# @api public
#
def tcp_connect_and_send(data,&block)
print_info "Connecting to #{host_port} ..."
print_debug "Sending data: #{data.inspect}"
@@ -134,10 +138,12 @@
# @yieldparam [TCPsocket] socket
# The newly created TCPSocket object.
#
# @return [nil]
#
+ # @see Network::TCP#tcp_session
+ #
# @api public
#
def tcp_session(&block)
print_info "Connecting to #{host_port} ..."
@@ -162,10 +168,12 @@
#
# @example
# tcp_banner
# # => "220 mx.google.com ESMTP c20sm3096959rvf.1"
#
+ # @see Network::TCP#tcp_banner
+ #
# @api public
#
def tcp_banner(&block)
print_debug "Grabbing banner from #{host_port}"
@@ -182,10 +190,12 @@
# @example
# buffer = "GET /" + ('A' * 4096) + "\n\r"
# Net.tcp_send(buffer)
# # => true
#
+ # @see Network::TCP#tcp_send
+ #
# @api public
#
def tcp_send(data)
print_info "Connecting to #{host_port} ..."
print_debug "Sending data: #{data.inspect}"
@@ -210,10 +220,12 @@
# The newly created server.
#
# @example
# tcp_server
#
+ # @see Network::TCP#tcp_server
+ #
# @api public
#
def tcp_server(&block)
print_info "Listening on #{self.server_host_port} ..."
@@ -242,10 +254,12 @@
#
# client1.close
# client2.close
# end
#
+ # @see Network::TCP#tcp_server_session
+ #
# @api public
#
def tcp_server_session(&block)
print_info "Listening on #{server_host_port} ..."
@@ -274,9 +288,11 @@
#
# @example
# tcp_single_server do |client|
# client.puts 'lol'
# end
+ #
+ # @see Network::TCP#tcp_server_single_server
#
# @api public
#
def tcp_single_server(&block)
print_info "Listening on #{server_host_port} ..."