Skip to content
Snippets Groups Projects
Commit 39ddca97 authored by Stephen R. van den Berg's avatar Stephen R. van den Berg
Browse files

SocketIO: Use variant to enforce compile-time checks.

parent 508f48ee
Branches
Tags
No related merge requests found
...@@ -267,11 +267,12 @@ class Client { ...@@ -267,11 +267,12 @@ class Client {
} }
//! Send text or binary events. //! Send text or binary events.
final void emit(string|function(mixed, mixed ...:void) ack_cb, final variant void emit(function(mixed, mixed ...:void) ack_cb,
mixed ... data) { string event, mixed ... data) {
if (!stringp(ack_cb) || !stringp(data[0])) write(ack_cb, event, @data);
DUSERERROR("Event must be of type string."); }
write(ack_cb, @data); final variant void emit(string event, mixed ... data) {
write(event, @data);
} }
private void send(int type, void|string|array data, private void send(int type, void|string|array data,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment