Method: Iodine::Connection#protocol
- Defined in:
- ext/iodine/iodine_connection.c
#protocol ⇒ Object
Returns the connection's protocol Symbol (:sse, :websocket or :raw).
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'ext/iodine/iodine_connection.c', line 276
static VALUE iodine_connection_protocol_name(VALUE self) {
// clang-format on
iodine_connection_data_s *c = iodine_connection_validate_data(self);
if (c) {
switch (c->info.type) {
case IODINE_CONNECTION_WEBSOCKET:
return WebSocketSymbol;
break;
case IODINE_CONNECTION_SSE:
return SSESymbol;
break;
case IODINE_CONNECTION_RAW: /* fallthrough */
return RAWSymbol;
break;
}
}
return Qnil;
}
|