Created
April 7, 2013 19:47
-
-
Save javajosh/5332187 to your computer and use it in GitHub Desktop.
Demonstrate a bug in either vertx or the documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//invoke with VERTX_OPTS="" vertx run vertx-bug.groovy | |
def client = vertx.createNetClient(); | |
//The docs appear to be wrong. TODO file bug with vertx http://vertx.io/core_manual_groovy.html#catching-exceptions-on-the-net-client | |
//Caused by: groovy.lang.MissingMethodException: No signature of method: org.vertx.groovy.core.net.impl.DefaultNetClient.exceptionHandler() is applicable for argument types: (vertx-bug$_run_closure1) values: [vertx-bug$_run_closure1@32d16fe3] | |
client.exceptionHandler { ex -> println "Failed to connect $ex"; container.exit() } | |
client.connect(1234, "localhost") { socket -> | |
socket.dataHandler { buffer -> | |
println "client recieved: ${buffer}" | |
container.exit() | |
} | |
def str = "hello" | |
print "client sending $str" | |
socket << str << "\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment