     fs.unlinkSync socketPath if fs.existsSync(socketPath)
     server = net.createServer (connection) =>
       connection.on 'data', (data) =>
-        options = JSON.parse(data)
-        @openPaths(options)
+        @openBasedOnOptions(JSON.parse(data))
 
     server.listen socketPath
     server.on 'error', (error) -> console.error 'Application server failed', error

  resourcePath: null
  version: null

  constructor: ({@resourcePath, pathsToOpen, urlsToOpen, @version, test, pidToKillWhenClosed, devMode, newWindow, specDirectory}) ->
    global.atomApplication = this

    @pidsToOpenWindows = {}

    @handleEvents()
    @checkForUpdates()

    @openBasedOnOptions(options)

  # Private: Opens a new window based on the options provided.
  openBasedOnOptions: ({pathsToOpen, urlsToOpen, test, pidToKillWhenClosed, devMode, newWindow, specDirectory}) ->
    if test
      @runSpecs({exitWhenDone: true, @resourcePath, specDirectory})
    else if pathsToOpen.length > 0
