Project
Loading...
Searching...
No Matches
DeviceController.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13#include "DPLWebSocket.h"
14#include "HTTPParser.h"
15#include "Framework/Logger.h"
16#include <uv.h>
17#include <vector>
18
19namespace o2::framework
20{
21
23 : mHandler{handler}
24{
25}
26
28{
29 LOG(debug) << "Saying hello";
30 std::vector<uv_buf_t> outputs;
31 encode_websocket_frames(outputs, "hello", strlen("hello"), WebSocketOpCode::Binary, 0);
32 mHandler->write(outputs);
33}
34
35void DeviceController::write(char const* message, size_t s)
36{
37 LOGP(debug, "Saying {} to device", message);
38 std::vector<uv_buf_t> outputs;
40 mHandler->write(outputs);
41}
42
43} // namespace o2::framework
std::ostringstream debug
GLuint GLsizei const GLchar * message
Definition glcorearb.h:2517
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
void encode_websocket_frames(std::vector< uv_buf_t > &outputs, char const *src, size_t size, WebSocketOpCode opcode, uint32_t mask)
DeviceController(WSDPLHandler *handler)
void write(const char *message, size_t s)
void write(char const *, size_t)
Helper to write a message to the associated client.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"