Coder Social home page Coder Social logo

websocket's Issues

send_a_frame

connection.cpp
send_a_frame function
the function of bufferevent_write return value is 0 or -1
fb->len is the real data length

so the return value always is -1

关于websocket 握手中 禁止EV_READ选项

哈喽, 我想问一下, 在websocket握手的时候,禁用调用libevent 的EV_READ选项, 如果这个时候客户端断掉连接, 应该不能及时的关闭掉连接, 并且 bufferevent_write向一个关闭的fd去写,也是不会触发异常的,这样连接对应的bufferevent是不是就释放不掉了呢?

Memory Leak in demo

Here is a valgrind snippet

==10036== 3,824 (1,072 direct, 2,752 indirect) bytes in 2 blocks are definitely lost in loss record 16 of 16
==10036==    at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10036==    by 0x4E52DA0: bufferevent_socket_new (bufferevent_sock.c:354)
==10036==    by 0x4020C1: listencb(evconnlistener*, int, sockaddr*, int, void*) (demo.cpp:41)
==10036==    by 0x4E6082E: listener_read_cb (listener.c:418)
==10036==    by 0x4E58538: event_persist_closure (event.c:1580)
==10036==    by 0x4E58538: event_process_active_single_queue (event.c:1639)
==10036==    by 0x4E58DEE: event_process_active (event.c:1738)
==10036==    by 0x4E58DEE: event_base_loop (event.c:1961)
==10036==    by 0x4022A6: main (demo.cpp:78)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.