Keeping socket open beyong map changes
Hi,
so I'm using the default sockets module to create a TCP connection to an IRC server. (The socket object is declared globally at the beginning of the script, the socked is opened in plugin_init() or via console command.) Now when the map changes, apparently the entire plugin is reloaded, resulting in the socket being closed (?) and reopened on the next map. How can I keep the socket open on map changes and maintain the connection continuously? Obviously, I don't want to have the IRC bot reconnect whenever the map is changed. Thank you for your input and any hints you can share with me. |
Re: Keeping socket open beyong map changes
Check IRC Server :). It says in description that you don't lose connection on mapchange, so see how hackziner coded it.
|
Re: Keeping socket open beyong map changes
Thank you for your reponse.
I've studied the code (as well as the code of two other IRC client plugins) but I'm unable to figure out what's to be done differently. :( |
Re: Keeping socket open beyong map changes
Alright, someone on the AMXX IRC channel pointed out that the socket object is stored in a cvar which then is accessed after the map has changed.
So the basic code is something along these lines: PHP Code:
|
Re: Keeping socket open beyong map changes
So, is that the answer to your question then? If yes, this means that the socket is not closed on map change by default I guess.
|
Re: Keeping socket open beyong map changes
Yes, that was the answer to my question, I'm sorry if I wasn't being clear enough.
In my initial post I said "resulting in the socket being closed (?)" because I suspected it wasn't an accurate description. I guess you could say that the socket is not closed but you just lose its handle which you store in a cvar. |
| All times are GMT -4. The time now is 20:31. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.