DikuMUD | Original Alfa release | Game Engine library
kandi X-RAY | DikuMUD Summary
kandi X-RAY | DikuMUD Summary
This github repo is intended to contain the original DikuMUD releases and we’ll see whatever it develops to from there. Please note the LGPL additions to licensing which you’ll find in the doc/license.doc document. Uploaded by Michael Seifert on 2020-02-03 20:02.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DikuMUD
DikuMUD Key Features
DikuMUD Examples and Code Snippets
Community Discussions
Trending Discussions on DikuMUD
QUESTION
I'm need help with websocketspp / websockets++ please (https://github.com/zaphoyd/websocketpp).
I'm open to other simpler libraries, also C, if that's an overall better option :)
My overall goal is to have a websockets webpage as a replacement for a telnet client for DikuMUD.
I've been using the "echo_server" example which is running fine.
I'm trying to save the connection handler "hdl" from one callback and then re-use it later to send another message back to the client. Looks to me like hdl is a class that will get created / destroyed on the stack with each function call to e.g. on_message.
I would like to store the hdl somehow, e.g. in a std::map so that I can look it up and use that looked up hdl to send another message later to the same client.
Here's the example. Sorry for the void , I'm used to C and lightweight C++ :)
...ANSWER
Answered 2020-Mar-15 at 10:00connection_hdl
is istelf a pointer, store connection_hdl
. It is a weak pointer.
Generally, suggest avoiding void*
with asio, and using reference-counted smart pointers. Even though you can control lifetime of object in a synchronous program, and call free
or delete
when needed, in asynchronous program the flow is varying, so the right place to free pointer could be different place each time.
asio may use boost::weak_ptr
or std::weak_ptr
. boost
one has operator <
, so can be directly used in a map. For std
, there's std::weak_ptr::owner_before
to be used for ordering, can be used via std::owner_less
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DikuMUD
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page