# File lib/eventmachine.rb, line 697
697:   def self.bind_connect bind_addr, bind_port, server, port=nil, handler=nil, *args
698:     begin
699:       port = Integer(port)
700:     rescue ArgumentError, TypeError
701:       # there was no port, so server must be a unix domain socket
702:       # the port argument is actually the handler, and the handler is one of the args
703:       args.unshift handler if handler
704:       handler = port
705:       port = nil
706:     end if port
707: 
708:     klass = klass_from_handler(Connection, handler, *args)
709: 
710:     s = if port
711:           if bind_addr
712:             bind_connect_server bind_addr, bind_port.to_i, server, port
713:           else
714:             connect_server server, port
715:           end
716:         else
717:           connect_unix_server server
718:         end
719: 
720:     c = klass.new s, *args
721:     @conns[s] = c
722:     block_given? and yield c
723:     c
724:   end