vert-x / mod-lang-scala

Vert.x 2.x is deprecated - use instead
https://github.com/vert-x3/vertx-lang-scala
Apache License 2.0
77 stars 29 forks source link

An example problem on manual #162

Closed Knovour closed 10 years ago

Knovour commented 10 years ago

Hi, I have a problem on the manual

The first start up example on the manual works well

import org.vertx.scala.core.net.NetSocket
import org.vertx.scala.core.streams.Pump

vertx.createNetServer().connectHandler({ socket: NetSocket =>
  Pump.createPump(socket, socket).start
}).listen(1234)

But the second example

import org.vertx.scala.core.net.NetSocket
import org.vertx.scala.core.streams.Pump
import org.vertx.scala.platform.Verticle

class Server extends Verticle {

  override def start() {
    vertx.createNetServer().connectHandler({ socket: NetSocket =>
        Pump.createPump(socket, socket).start
    }).listen(1234)
  }
}

It started without error, but telnet said: "Unable to connect to remote host".

Did I miss something ? Thank you.

galderz commented 10 years ago

The problem is that the package name is missing in the class for it to be considered a class. I've just realised this was an issue that was present in the current documentation.

I've sent a PR to fix it: https://github.com/vert-x/vert-x.github.io/pull/38