lib/polyphony/net.rb
# Creates a server socket for accepting incoming connection on the given
# host and port. If `opts[:secure]` is true, or if an SSL context is given
# in `opts[:secure_context]`, a TLS handshake is performed, and an
# SSLSocket is returned.
#
# @param host [String] hostname
# @param port [Integer] port number
# @param opts [Hash] connection options
# @return [TCPServer, SSLServer] listening socket
Creates a server socket for accepting incoming connection on the given
host and port. If `opts[:secure]` is true, or if an SSL context is given
in `opts[:secure_context]`, a TLS handshake is performed, and an
SSLSocket is returned.
Creates a server socket for accepting incoming connection on the given host and port . If ` opts [ : secure ] ` is true or if an SSL context is given in ` opts [ : secure_context ] ` a TLS handshake is performed and an SSLSocket is returned .
def tcp_listen(host = nil, port = nil, opts = {})
        host ||= '0.0.0.0'
        raise 'Port number not specified' unless port
        socket = listening_socket_from_options(host, port, opts)
        if opts[:secure_context] || opts[:secure]
          secure_server(socket, opts[:secure_context], opts)
        else
          socket
        end
      end
def tcp_listen ( host = nil , port = nil , opts = { } ) host ||= '0.0.0.0' raise 'Port number not specified' unless port socket = listening_socket_from_options ( host , port , opts ) if opts [ :secure_context ] || opts [ :secure ] secure_server ( socket , opts [ :secure_context ] , opts ) else socket end end
Creates a server socket for accepting incoming connection on the given
host and port.
Creates a server socket for accepting incoming connection on the given host and port .
None
TCPServer, SSLServer
host
None
port
None
opts
None