-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unbootstrap #2733
Comments
You cant. You will have to destroy the tox object to be offline, and when you want to come online again you have to recreate it. You can try using TCP only, as this might reduce traffic. Also NewGroupChats support disconnecting without destroying its state. |
If you want to go offline without destroying the Tox instance, simply stop calling If you want to go offline immediately however, without others still seeing you as being online until some timeout amount of time passes on their end, the Tox instance would need to send packets to others telling that it's shutting down, which is done only when the Tox instance is destroyed, there is no option to send those without destroying it. What you can do in this case to still access the Tox struct is re-create it back after destroying it but with network settings that prevent it from connecting to anything. So before you destroy the Tox instance you would call |
Can You explain? what options? It seems that such a feature is indeed missing and would be worth adding. Go offline mode. Just not using the main loop is not elegant or fast. Besides, you still have open ports and may be charged for Internet usage. Especially painful when roaming. |
The "don't call |
Why do you need the Tox structure to not be destroyed? |
@og1en can you please give more details? are you using a tox client? if so which one? if so, as mentioned, when you stop calling tox_iterate() in your code then tox will not do any networking activity anymore (connections will timeout). automatic reconnecting and bootstrapping is only done in tox clients. |
@fab1an2 I see you 👎 my question. Was it a bad question? I'm trying to understand how to solve the problem. |
This comment was marked as off-topic.
This comment was marked as off-topic.
The requirements I see so far are:
The 4th requirement means you will need to reopen those ports/sockets and rebuild the network connections, which will take around 10 seconds (regular bootstrap). Overall, you can achieve everything except 1) by doing So the question remains: why do you want the struct to remain alive? An alternative question might be, since you're looking for a feature to be added to toxcore: do you want a function in toxcore that implements the method I described above? |
I'm not undestand what 4. point will be. I pay for open ports, for something being sent over the network, etc. I would like my program to be able to create messages but not send them. Just like thunderbird https://www.thunderbird.net/ . I can write a dozen emails and only when I have the network on, or when I realistically hit the exchange button only then do I send and receive data. And so I can quietly turn on the program, write data. I do not need to inform that I change the status to busy. Although it is possible. It is just that for me it is not the most important thing. I simply want to disable the network plug from the wall for this particular program. Go offline but still be able to write messages and read them.
|
You don't need to disconnect from the tox network to achieve this. You can simply write a message queue that holds your messages until your trigger condition, then batch sends them. Your trigger condition could be a manual button that you click, or it could be upon detection that the message's respective contact has come online. |
Tox does not store sent messages permanently. In particular, if you are not online or your friend is not online, you can't send messages through toxcore. If you send a message when the friend appears online, but they don't actually receive it (e.g. network issues), then toxcore will drop the message on the floor (you don't get a delivery receipt then). It sounds like what you want is a storage to put messages in until you're online and able to send them all in a batch. This is something usually implemented in clients rather than in toxcore. If you want to close network sockets, then Given that Toxcore is not able to enqueue messages when offline, is there a reason to keep the struct alive even when offline? |
Is it like VPN port forwarding, where the VPN service assigns you an open TCP port to use? If so, depending on how the service you use exactly works, you might not need to open any ports as Tox does NAT hole-punching, and in the case that doesn't work, you could use a TCP relay.
Just want to make sure you understand that Tox doesn't work like email. Tox doesn't support offline/asynchronous messaging. For your messages to be sent, both the sender and the receiver have to be online at the same time. Sender sends messages directly to the receiver, there is no intermediary that will hold sender's messages and relay them to the receiver once they are online. If the receiver or the sender (or both) are offline, no message can be sent or received.
Toxcore won't let you queue up messages to be sent while you or the receiver are offline, it's designed to send the messages right away. If you need such a message queue, that's something you have implement on top of Toxcore in your own code. |
I need turn off network but not destroy tox structure. I need turn on/off network many times in my program, not only one.
How turn off automatic reconecting network ?
The text was updated successfully, but these errors were encountered: