小编Tho*_*van的帖子

不将数据socket.io c++(客户端)发送到socket.io nodejs(服务器)

对于我的项目,我想从应用程序 (c++) 到 Web服务器 (NodejS) 与 Socket.io 进行通信。

我们之间的联系有效,但是当我发出消息时,什么也没有发生......

客户端(C++)

int main(int argc, char const *argv[])
{
  sio::client h;
  h.connect("http://x.x.x.x:xxxx");
  string mess = "Bonjour !!!";
  h.socket()->emit("new message", mess); // Nothing is happening
  cout << "Message sended ..." << mess << endl;
  ...
}
Run Code Online (Sandbox Code Playgroud)

服务器(NodeJ)

...
const io = require('socket.io')(server);

io.on('connection', (socket) => {
  console.log("New connexion..."); // It's Work

  socket.on('new message', function (data) { 
    console.log(data); // Never fire
  });
});


server.listen(xxxx, () => {
    console.log(`Server started on port xxxx`); …
Run Code Online (Sandbox Code Playgroud)

c++ boost websocket node.js socket.io

5
推荐指数
1
解决办法
1424
查看次数

为 ARM 交叉编译 zlib

我尝试为 arm-poky-linux-gnueabi 交叉编译 zlib,但在启动 make 时出现错误:

...:~/zlib-1.2.11$ AR=$HOST-ar CC=$HOST-gcc RANLIB=$HOST-ranlib ./configure --prefix=$HOME/zlibARM 
Checking for shared library support... 
Building shared library libz.so.1.2.11 with arm-poky-linux-gnueabi-gcc. 
Checking for size_t... Yes. 
Checking for off64_t... Yes. 
Checking for fseeko... Yes. 
Checking for strerror... Yes. 
Checking for unistd.h... Yes. 
Checking for stdarg.h... Yes. 
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf(). 
Checking for vsnprintf() in stdio.h... Yes. 
Checking for return value of vsnprintf()... Yes. 
Checking for attribute(visibility) support... Yes.

...:~/zlib-1.2.11$ make
arm-poky-linux-gnueabi-gcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN …
Run Code Online (Sandbox Code Playgroud)

gcc arm compiler-errors makefile zlib

3
推荐指数
1
解决办法
2901
查看次数

标签 统计

arm ×1

boost ×1

c++ ×1

compiler-errors ×1

gcc ×1

makefile ×1

node.js ×1

socket.io ×1

websocket ×1

zlib ×1