socket.removeListener not working in socket io client - socket.io

I am trying to disconnect sockect io connection but after reload the page reconnect on show old Listener also. In short say unable to socket.removeListener. I am using socket io 4.5.1

Related

Hook the socket connection of an application on windows/macos

I have an application that when it is launched, opens a socket connection to a certain server. I want to change the IP and Port of that socket connection to redirect the connection to my proxy server, in order to retrieve all the packets.
I want to do it on both macos and windows. I know there is function in MacOs that allows to modify the memory of a process so the question would be, how to know where is the socket structure in the memory when the application is running and when do I know when the socket connection is starting ?
And on Windows, I heard about DLL ? But I am really lost on it and I dont really understand it.
Any thoughts ?

Getting socket create,accept callback

I am trying to get process id of the client which initiated a connection to the remote system/website.
Is it possible to write wfp driver which gets a callback for socket create/accept event! if not through wfp, what are the other options available?

Winsock Kernel - Reusing socket return error 0xc0000184

I am developing WDF driver that uses Winsock Kernel module connecting network. I have encounter problem when I try to reuse socket. I am successfully creating, binding and connecting socket. After that I am disconnecting socket with WskDisconnect function with success status. However when I try to reconnect using same socket I get error 0xc0000184. Any ideas why I can't reuse my socket? Binding fails as well.

Should we close the client socket also?

Please refer to the ASIO examples at: http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/examples/cpp03_examples.html
The connection class code is at : http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/example/cpp03/http/server/connection.cpp
This class has a stop() function which calls stop on socket that has been created corresponding to a connection request to server (from void server::start_accept())
The client code resides at : http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/example/cpp03/http/client/sync_client.cpp
This class also creates a socket at the client end, but this code does not close the socket.
So, there are 2 sockets that are opened: from client to server and vice-a-versa
Questions:
1) Is just closing the socket which the server has opened sufficient or should we also call close on the socket inside the client code ?
2) Should we call shutdown on socket before calling close ?
You have to close everything that is closeable.
Shutdown before close is redundant unless you have forked a process and inherited the socket.

Boost asio network disconnection handling

I am using boost asio for my TCP Server, in this I am using async_read_some for reading .
Application is working fine when network is connected, normal connection closing are handled correctly like (EOF,abrupt closing).
But my problem is I am not getting any error when network cable is unplugged. socket is open , and I get error when I am writing on socket. This is the way socket work.
Question: Can this is handled in Boost asio by any method?
You may want to set "keep alive" on the socket, see Socket closed notification. Try:
socket.set_option(boost::asio::socket_base::keep_alive(true));

Resources