manual connect
See original GitHub issueHi,
I have in my app.modules.ts this:
const config: SocketIoConfig = { url: ${environment.host}
, options: {} };
…
imports: [
… SocketIoModule.forRoot(config)
],
My socket.io be connected at bootstrap. Can I connect socket manually ? Tnx
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Windows Manual Connection Steps - Computing Services
Windows Manual Connection Steps. Follow the steps below to manually connect to the CMU-SECURE network. Step 1: Remove the Existing Wi-Fi Profile.
Read more >Windows 10 - How to Manually Connect to a Wi-Fi Network
1. From the Windows desktop, navigate: Start Settings iconWi-Fi. 2. From the Related settings section, select Network and Sharing Center. 3. Select Set...
Read more >connect(2) - Linux manual page - man7.org
CONNECT(2) Linux Programmer's Manual CONNECT(2) ... The connect() system call connects the socket referred to by the file descriptor sockfd to the address ......
Read more >How to set up a manual connection on Windows using ...
How to set up a manual connection on Windows using OpenVPN · Download the OpenVPN GUI application. · Open the installation file and...
Read more >Connect Care Manual
This online manual gathers tips, guides, resources and norms for prescribers who use the Connect Care clinical information system (CIS).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes you can, first add option autoConnect : false
const config: SocketIoConfig = { url: ${environment.host}, options: { autoConnect : false } };
then, in Socketservices.ts create a method Connect() with params as you want. Now you can call the method and reconfigure the connections and options of socket instance.
Example:
@feof The socket connection automatically establishes at bootstrap because of the configuration in App module. If you want to connect socket manually, a workaround could be to disconnect socket connection (
this.socket.disconnect()
) at bootstrap and connect (this.socket.connect()
) again whenever it’s needed.