Serializable::inspect
to show more useful information
msgpack :: serialization_common
Serialization services forserialization_write
and serialization_read
serialization :: serialization_core
Abstract services to serialize Nit objects to different formatsdeserialize_json
and JsonDeserializer
msgpack :: serialization_write
Serialize full Nit objects to MessagePack formatserialize_to_json
and JsonSerializer
core :: union_find
union–find algorithm using an efficient disjoint-set data structure
# Services common to the `client` and `server` modules
module common
import socket
import msgpack
# Unique name of the application to use in the handshake
#
# This name must be the same between client/server and
# it should not be used by other programs that may interfere.
# Both client and server refuse connections with a different name.
#
# This value must not contain spaces.
fun handshake_app_name: String do return program_name
# Version of the communication protocol to use in the handshake
#
# Its value should change with the communication protocol in such a way
# that different versions indicates incompatible protocols.
#
# Both client and server refuse connections with a different version.
#
# This value must not contain spaces.
fun handshake_app_version: String do return "0.0"
# Server port listening for discovery requests
#
# This name must be the same between client/server.
fun discovery_port: Int do return 18722
# First word in discovery requests
private fun discovery_request_message: String do return "gamnit::network?"
# First word in discovery responses
private fun discovery_response_message: String do return "gamnit::network!"
lib/gamnit/network/common.nit:15,1--49,75