Oops, that went directly into the stable branch earlier.

This commit is contained in:
Florian Nücke 2015-03-27 15:52:22 +01:00
parent b6d20aa344
commit ef6d251c30

View File

@ -47,7 +47,7 @@ class InternetCard extends prefab.ManagedEnvironment {
@Callback(direct = true, doc = """function():boolean -- Returns whether HTTP requests can be made (config setting).""") @Callback(direct = true, doc = """function():boolean -- Returns whether HTTP requests can be made (config setting).""")
def isHttpEnabled(context: Context, args: Arguments): Array[AnyRef] = result(Settings.get.httpEnabled) def isHttpEnabled(context: Context, args: Arguments): Array[AnyRef] = result(Settings.get.httpEnabled)
@Callback(doc = """function(url:string[, postData:string]):boolean -- Starts an HTTP request. If this returns true, further results will be pushed using `http_response` signals.""") @Callback(doc = """function(url:string[, postData:string]):userdata -- Starts an HTTP request. If this returns true, further results will be pushed using `http_response` signals.""")
def request(context: Context, args: Arguments): Array[AnyRef] = this.synchronized { def request(context: Context, args: Arguments): Array[AnyRef] = this.synchronized {
checkOwner(context) checkOwner(context)
val address = args.checkString(0) val address = args.checkString(0)
@ -66,7 +66,7 @@ class InternetCard extends prefab.ManagedEnvironment {
@Callback(direct = true, doc = """function():boolean -- Returns whether TCP connections can be made (config setting).""") @Callback(direct = true, doc = """function():boolean -- Returns whether TCP connections can be made (config setting).""")
def isTcpEnabled(context: Context, args: Arguments): Array[AnyRef] = result(Settings.get.tcpEnabled) def isTcpEnabled(context: Context, args: Arguments): Array[AnyRef] = result(Settings.get.tcpEnabled)
@Callback(doc = """function(address:string[, port:number]):number -- Opens a new TCP connection. Returns the handle of the connection.""") @Callback(doc = """function(address:string[, port:number]):userdata -- Opens a new TCP connection. Returns the handle of the connection.""")
def connect(context: Context, args: Arguments): Array[AnyRef] = this.synchronized { def connect(context: Context, args: Arguments): Array[AnyRef] = this.synchronized {
checkOwner(context) checkOwner(context)
val address = args.checkString(0) val address = args.checkString(0)