h$SK      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-Low-level bindings to the netcode.io library.(c) Pavel Krajcevski, 2020BSD-3krajcevski@gmail.com experimentalPortable Safe-Inferred230 netcode-ioFor testing only.  !"#$%&'()-,+*./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~()-,+*&'$%"#! }{~|ywzuxsvqtropn mkilgjehcfad_b]`[^\YWZUXSVTQROMPKNILJGHECFADB?=@>;<:7968531420/. Safe-Inferred38  netcode-ioThe address mode based on how the address is represented. Usually a consequence of how it was parsed. netcode-io)Usually when address is stored encrypted. netcode-ioAn opaque type that encapsulates an address that can be used with  netcode.io. The address may be stored in memory in different ways (for example with encryption), and therefore needs the IO monad to interact with it. .https://github.com/Mokosha/netcode-io/issues/1TODO: Use a high-level representation here to enable a more pure interface. netcode-ioReturns the address mode for the given address. Note, this address may be stored in memory in different ways, so we must inspect the memory contents in order to retreive the addressing mode. netcode-io.Returns the port associated with this address. netcode-ioReturns the address as a sequence of values in its human readable format. For example:0parseAddress "123.231.132.213" >>= addressValues[123, 231, 132, 213]The length of the list is either 4 or 8 depending on the address mode. If the address mode is unknown,  returns the empty list. netcode-ioReturns an address with the given values interpreted using the given mode. For IPv4 addresses, only the bottom 8 bits of each 16-bit word will be used. The list will be zero padded to contain enough values to fill the address as needed. netcode-ioTakes a  and parses it to create an . The string should be formatted as either a valid IPv4 or IPv6 address. It does not, however, support dual address modes. netcode-io+Returns a string that represents the given . netcode-ioReturns True if two addresses are equal by examining their memory contents. netcode-ioPort Safe-Inferred netcode-ioOverride that receives a packet from the given address. This can be used by both clients and servers. This is invoked before  netcode.io) processes and decrypts the packet data.Implementations of this callback are meant to fill the memory at the given pointer with the data from a packet received from the . The maximum size of the buffer pointed to is also passed and the implementation is expected to return the actual size of the packet. In the event that there is no packet (or equivalently, no packet data), then the implementation should return zero. netcode-ioOverride that sends a packet to the given address. This can be used by both clients and servers. This is invoked after  netcode.io$ processes and encrypts the packet. netcode-io&Address from which to receive a packet netcode-io0Pointer to the buffer where to write packet data netcode-io+Maximum size of destination buffer in bytes netcode-io+Return value: should be size of packet data netcode-io to send the packet to netcode-io2A pointer to the memory that holds the packet data netcode-ioThe size of the packet Safe-Inferred8 netcode-ioA packet is a basic unit of data that is transferred between client and server. Sequence numbers indicate the order in which the packets were sent, and this library contains no guarantee that they will be received in a monotonically increasing order. netcode-io$The sequence number for this packet. netcode-io*The size, in bytes, of the data stored at  netcode-ioA pointer to the bytes that are contained in this packet. This can be cast to any pointer type for the purposes of deseralizing, but this pointer must outlive the amount of time that this library has been initialized. netcode-ioThe maximum size, in bytes, of a packet. In other words, this is the maximum value that  can take. Safe-Inferred38- netcode-ioA  represents an encrypted set of data fields that describe both the client requesting to make a connection and the available servers to which that connection can be made. It is generated solely via the  netcode-ioA client-specific callback that gets invoked each time the underlying state of the client changes. netcode-ioA , is a type that specifies the behavior of a . Client configs are pretty spartan: the only options available at this time are setting callbacks. netcode-ioA client object. This is an opaque type meant to be used in conjunction with this library.A  is generally meant to connect to one of potentially many servers through a . The main loop of the application that manages the lifetime of the client is expected to maintain a running timer with a resolution of at least seconds. This main loop is also expected to call  on a regular basis to allow the library to process incoming packets and send outgoing packets. netcode-io$The possible connection states of a . The default state is . netcode-ioA  with no callback overrides. netcode-io+Creates a config that removes the existing & and instead uses the given callback. netcode-io Clears the  for the given config. netcode-ioRemoves the existing send and receive overrides for the given config, if set, and instead uses the ones given. netcode-ioChanges the config to use the default send and receive packet functions. netcode-ioCreates a client at the given address using the provided config. Throws an IOException on failure.Note, the address used here can be either formatted as an IPv4 address or an IPv6 address, similar to the arguments passed to . In the common case, you will likely want to use INADDR_ANY to bind to the underlying socket, which is represented by the address "0.0.0.0"The time passed to this create function should be a measurement in seconds, such that when connecting in the future using , the same resolution timer is being passed. That allows the library to properly timeout in cases where connections are taking too long to establish. netcode-ioDestroys the client and frees all of the Haskell-side function pointers that were registered as callbacks. netcode-io4Generates a random 64-bit client ID to be used with  netcode-ioBegin the process to connect the client to a server stored in the given . This does not connect the client immediately, but rather resets the client object and sets the state to :. The client will attempt to connect on the next call to . netcode-io>Disconnects the client from anything it might be connected to. netcode-ioMain processing call for clients with the current time in seconds (in the same domain as the time passed to ). This flushes packet queues at the appropriate rate and updates connection statuses among other things. It is expected to be called in the main loop of the application. netcode-io!Returns the current state of the . netcode-ioReturns true if the  is in a state considered to be disconnected, as opposed to connected or connecting. netcode-io8Returns the sequence number of the next packet that the  will send. netcode-io5Enqueues a packet to be sent during the next call to . netcode-io$Dequeues a received packet from the . This function returns a Just6 until the queue is empty, upon which it will return Nothing. netcode-io"Returns the port assigned to this . netcode-ioPerforms an action with the address of the server to which the given  is connected to. This is meant to minimize the chances that the 8 value will be used in a manner that outlives the given $. Callers should avoid storing the 5 value or returning it as a result of this function.In the event that the client is not connected to a server, the address passed to the action will be 0.0.0.0. netcode-io;Gives the maximum size, in bytes, of user data stored in a . netcode-io?Returns the maximum number of servers that can be stored in a . netcode-ioReturns the number of bytes expected in the private key used to generate a  netcode-ioCreates a connect token for the given client (by clientID) with the list of associated addresses. User data may be at most  values, otherwise is truncated or zero-padded to fill. The list of public and internal servers must not be empty and may contain at most  values, otherwise is truncated. Throws an IOException on failure. netcode-io Old state netcode-io New state netcode-ioPublic and internal servers netcode-ioToken expiration in seconds netcode-ioToken timeout in seconds netcode-ioUnique Client ID netcode-io Protocol ID netcode-io Private key netcode-io User data% Safe-InferredF  netcode-ioA server-specific callback that gets invoked each time a client either connects to, or disconnects from, the server. netcode-ioA , is a type that specifies the behavior of a # and contains associated metadata.At a minimum, the connection protocol ID and the private key for the application should be set for each server (via  and , respectively). netcode-ioA server object. This is an opaque type meant to be used in conjunction with this library.A server is generally meant to represent and endpoint for one or more   s to connect to. The server application is similar to that of the client in that it is expected to have a running timer with a resolution of at least seconds. The main loop of the server application is meant to call  to allow the library to process incoming packets and send outgoing packets to the clients. netcode-io The default  contains no callbacks or overrides, and contains empty values for the required fields needed to properly have a server respond to a connecting  . netcode-io-Sets the connection protocol ID used by this . This is a unique ID that must match the protocol ID used in   netcode-io"Sets the private key used by this /. This key must match the private key used in   netcode-ioReplaces the existing  with the given one and frees any associated memory that may be allocated for the the existing callback. netcode-ioRemoves the existing  and frees any associated memory that may be allocated for the the existing callback. netcode-ioRemoves the existing send and receive overrides for the given config, if set, and instead uses the ones given. netcode-ioChanges the config to use the default send and receive packet functions. netcode-ioCreates a server at the given address using the provided config. Throws an IOException on failure.Note, the address used here can be either formatted as an IPv4 address or an IPv6 address, similar to the arguments passed to . In the common case, you will likely want to use INADDR_ANY to bind to the underlying socket, which is represented by the address "0.0.0.0"The time passed to this create function should be a measurement in seconds, such that when connecting in the future using , the same resolution timer is being passed. That allows the library to properly timeout in cases where connections are taking too long to establish. netcode-ioStarts the server and specifies the maximum number of clients that can connect. Emits a warning when the maximum number of clients is more than . netcode-ioReturns the maximum number of clients that a server can support. netcode-ioStops the server. netcode-ioDestroys the server object and frees the associated Haskell-side callbacks and overrides netcode-ioMain processing call for a  with the current time in seconds (in the same domain as the time passed to ). This flushes packet queues at the appropriate rate and updates connection statuses among other things. It is expected to be called in the main loop of the application. netcode-ioReturns True if the client at the given client index is connected to the server. Returns False if not connected, if the server is not running, or if the client index is out of bounds. netcode-ioReturns the client ID of the client at the given client index. Returns 0 if not connected, the server is not running, or if the client index is out of bounds. netcode-ioPerforms an action with the address of the client to which the given  is connected to. This is meant to minimize the chances that the 8 value will be used in a manner that outlives the given  or the connection lifetime of the client. Callers should avoid storing the 4 value or returning it as a result of this function.In the event that the client index is out of bounds, or the client is not connected at that slot, the address passed to the action will be 0.0.0.0. netcode-ioPerforms an action with the user data of the client to which the given  is connected to. This is meant to minimize the chances that the memory buffer will be used in a manner that outlives the given  or the connection lifetime of the client. Callers should avoid storing the Ptr4 value or returning it as a result of this function.In the event that the client index is out of bounds, or the client is not connected at that slot, the given action will receive nullPtr. netcode-ioReturns the user data for the client connected at the given client index.In the event that the client index is out of bounds, or the client is not connected at that slot, the result will be the empty list. netcode-ioReturns the maximum number of clients that can connect to this server, or zero if the server has not been started yet (via a call to ). netcode-io2Returns the number of currently connected clients. netcode-ioReturns True if the server has been started, and is ready to accept incoming connections from clients. netcode-ioReturns true if the number of connected clients matches the maximum number of possibly connected clients. netcode-io5Returns the port assigned to the server's IP address. netcode-io:Disconnects the client at the given index from the server. netcode-io(Disconnects all clients from the server. netcode-ioReturns the next sequence number of a packet destined for the client at the given client index. netcode-ioEnqueues a packet to be sent to the client at the given index during the next call to . netcode-ioEnqueues a packet with the given size and data to all connected clients. netcode-io$Dequeues a received packet from the  5 at the given client index. This function returns a Just8 until the queue is empty, upon which it will return a Nothing. netcode-ioClient index connected netcode-ioTrue if the client connected netcode-io Client index netcode-ioSize in bytes of packet data netcode-ioPacket data buffer .High-level bindings to the netcode.io library.(c) Pavel Krajcevski, 2020BSD-3krajcevski@gmail.com experimentalPortable Safe-Inferred38JV netcode-io"Specifies the logging behavior of  netcode.io9. Note, this logging behavior is called from C calls to printf and therefore might interfere with the Haskell runtime (such as ). netcode-ioInitializes the  netcode.io library runtime. This should be called before any additional functions in this library. Throws an    on failure. netcode-ioTerminates the  netcode.io library runtime. This should be called only after all other library functions terminate. netcode-ioSet the  netcode.io . The default is . netcode-ioSleep the current thread. This is usually only used in example programs. It's probably safer to use the built-in . !"#$%&'()*+,-./00112233456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  'netcode-io-0.0.3-9xepEf1EZTT2RFu8Aba0L2Bindings.Netcode.IO Netcode.IONetcode.IO.AddressNetcode.IO.CallbacksNetcode.IO.PacketNetcode.IO.ClientServerNetcode.IO.Server Network.IOClientgenerateConnectTokenControl.Exception IOExceptionControl.Concurrent threadDelayC'netcode_assert_function_tyC'netcode_server_config_t%c'netcode_server_config_t'protocol_id%c'netcode_server_config_t'private_key+c'netcode_server_config_t'allocator_context+c'netcode_server_config_t'allocate_function'c'netcode_server_config_t'free_function+c'netcode_server_config_t'network_simulator*c'netcode_server_config_t'callback_context5c'netcode_server_config_t'connect_disconnect_callback7c'netcode_server_config_t'send_loopback_packet_callback3c'netcode_server_config_t'override_send_and_receive.c'netcode_server_config_t'send_packet_override1c'netcode_server_config_t'receive_packet_overrideC'netcode_client_config_t+c'netcode_client_config_t'allocator_context+c'netcode_client_config_t'allocate_function'c'netcode_client_config_t'free_function+c'netcode_client_config_t'network_simulator*c'netcode_client_config_t'callback_context/c'netcode_client_config_t'state_change_callback7c'netcode_client_config_t'send_loopback_packet_callback3c'netcode_client_config_t'override_send_and_receive.c'netcode_client_config_t'send_packet_override1c'netcode_client_config_t'receive_packet_overrideC'receive_packet_override_tC'send_packet_override_t!C'send_loopback_packet_callback_tC'connect_disconnect_callback_tC'state_change_callback_tC'free_function_tC'allocate_function_tC'netcode_server_tC'netcode_client_tC'netcode_network_simulator_tC'netcode_address_tc'netcode_address_t'data'ipv4c'netcode_address_t'data'ipv6c'netcode_address_t'portc'netcode_address_t'typep'netcode_testc'netcode_testp'netcode_timec'netcode_timep'netcode_sleepc'netcode_sleepp'netcode_random_bytesc'netcode_random_bytesp'netcode_set_assert_functionc'netcode_set_assert_functionmK'netcode_assert_function_tymk'netcode_assert_function_typ'netcode_log_levelc'netcode_log_levelp'netcode_server_get_portc'netcode_server_get_port(p'netcode_server_process_loopback_packet(c'netcode_server_process_loopback_packet p'netcode_server_client_loopback c'netcode_server_client_loopback+p'netcode_server_disconnect_loopback_client+c'netcode_server_disconnect_loopback_client(p'netcode_server_connect_loopback_client(c'netcode_server_connect_loopback_clientp'netcode_server_process_packetc'netcode_server_process_packet!p'netcode_server_client_user_data!c'netcode_server_client_user_data&p'netcode_server_num_connected_clients&c'netcode_server_num_connected_clientsp'netcode_server_free_packetc'netcode_server_free_packetp'netcode_server_receive_packetc'netcode_server_receive_packetp'netcode_server_send_packetc'netcode_server_send_packet%p'netcode_server_next_packet_sequence%c'netcode_server_next_packet_sequence'p'netcode_server_disconnect_all_clients'c'netcode_server_disconnect_all_clients"p'netcode_server_disconnect_client"c'netcode_server_disconnect_clientp'netcode_server_client_addressc'netcode_server_client_addressp'netcode_server_client_idc'netcode_server_client_id!p'netcode_server_client_connected!c'netcode_server_client_connectedp'netcode_server_updatec'netcode_server_updatep'netcode_server_max_clientsc'netcode_server_max_clientsp'netcode_server_runningc'netcode_server_runningp'netcode_server_stopc'netcode_server_stopp'netcode_server_startc'netcode_server_startp'netcode_server_destroyc'netcode_server_destroyp'netcode_server_createc'netcode_server_createp'netcode_default_server_configc'netcode_default_server_config p'netcode_generate_connect_token c'netcode_generate_connect_tokenp'netcode_client_server_addressc'netcode_client_server_addressp'netcode_client_get_portc'netcode_client_get_port(p'netcode_client_process_loopback_packet(c'netcode_client_process_loopback_packetp'netcode_client_loopbackc'netcode_client_loopbackp'netcode_client_process_packetc'netcode_client_process_packet$p'netcode_client_disconnect_loopback$c'netcode_client_disconnect_loopback!p'netcode_client_connect_loopback!c'netcode_client_connect_loopbackp'netcode_client_max_clientsc'netcode_client_max_clientsp'netcode_client_indexc'netcode_client_indexp'netcode_client_statec'netcode_client_statep'netcode_client_disconnectc'netcode_client_disconnectp'netcode_client_free_packetc'netcode_client_free_packetp'netcode_client_receive_packetc'netcode_client_receive_packetp'netcode_client_send_packetc'netcode_client_send_packet%p'netcode_client_next_packet_sequence%c'netcode_client_next_packet_sequencep'netcode_client_updatec'netcode_client_updatep'netcode_client_connectc'netcode_client_connectp'netcode_client_destroyc'netcode_client_destroyp'netcode_client_createc'netcode_client_createp'netcode_default_client_configc'netcode_default_client_configmK'receive_packet_override_tmk'receive_packet_override_tmK'send_packet_override_tmk'send_packet_override_t"mK'send_loopback_packet_callback_t"mk'send_loopback_packet_callback_t mK'connect_disconnect_callback_t mk'connect_disconnect_callback_tmK'state_change_callback_tmk'state_change_callback_tmK'free_function_tmk'free_function_tmK'allocate_function_tmk'allocate_function_tp'netcode_address_equalc'netcode_address_equalp'netcode_address_to_stringc'netcode_address_to_stringp'netcode_parse_addressc'netcode_parse_addressp'netcode_termc'netcode_termp'netcode_initc'netcode_initc'NETCODE_CONNECT_TOKEN_BYTESc'NETCODE_KEY_BYTESc'NETCODE_MAC_BYTESc'NETCODE_USER_DATA_BYTES!c'NETCODE_MAX_SERVERS_PER_CONNECT,c'NETCODE_CLIENT_STATE_CONNECT_TOKEN_EXPIRED,c'NETCODE_CLIENT_STATE_INVALID_CONNECT_TOKEN+c'NETCODE_CLIENT_STATE_CONNECTION_TIMED_OUT4c'NETCODE_CLIENT_STATE_CONNECTION_RESPONSE_TIMED_OUT3c'NETCODE_CLIENT_STATE_CONNECTION_REQUEST_TIMED_OUT(c'NETCODE_CLIENT_STATE_CONNECTION_DENIED#c'NETCODE_CLIENT_STATE_DISCONNECTED1c'NETCODE_CLIENT_STATE_SENDING_CONNECTION_REQUEST2c'NETCODE_CLIENT_STATE_SENDING_CONNECTION_RESPONSE c'NETCODE_CLIENT_STATE_CONNECTEDc'NETCODE_MAX_CLIENTSc'NETCODE_MAX_PACKET_SIZEc'NETCODE_LOG_LEVEL_NONEc'NETCODE_LOG_LEVEL_ERRORc'NETCODE_LOG_LEVEL_INFOc'NETCODE_LOG_LEVEL_DEBUG c'NETCODE_OKc'NETCODE_ERRORc'NETCODE_ADDRESS_NONEc'NETCODE_ADDRESS_IPV4c'NETCODE_ADDRESS_IPV6p'netcode_address_t'data'ipv4p'netcode_address_t'data'ipv6p'netcode_address_t'portp'netcode_address_t'type+p'netcode_client_config_t'allocator_context+p'netcode_client_config_t'allocate_function'p'netcode_client_config_t'free_function+p'netcode_client_config_t'network_simulator*p'netcode_client_config_t'callback_context/p'netcode_client_config_t'state_change_callback7p'netcode_client_config_t'send_loopback_packet_callback3p'netcode_client_config_t'override_send_and_receive.p'netcode_client_config_t'send_packet_override1p'netcode_client_config_t'receive_packet_override%p'netcode_server_config_t'protocol_id%p'netcode_server_config_t'private_key+p'netcode_server_config_t'allocator_context+p'netcode_server_config_t'allocate_function'p'netcode_server_config_t'free_function+p'netcode_server_config_t'network_simulator*p'netcode_server_config_t'callback_context5p'netcode_server_config_t'connect_disconnect_callback7p'netcode_server_config_t'send_loopback_packet_callback3p'netcode_server_config_t'override_send_and_receive.p'netcode_server_config_t'send_packet_override1p'netcode_server_config_t'receive_packet_override$fStorableC'netcode_address_t#$fStorableC'netcode_client_config_t#$fStorableC'netcode_server_config_t$fEqC'netcode_server_config_t$fShowC'netcode_server_config_t$fEqC'netcode_client_config_t$fShowC'netcode_client_config_t$fEqC'netcode_address_t$fShowC'netcode_address_t AddressModeAddressMode'UnknownAddressMode'IPv4AddressMode'IPv6Address addressMode addressPort addressValuesconstructAddress parseAddressaddressToString addressEqualReceivePacketOverrideSendPacketOverridePacketpacketSequenceNumber packetSize packetDataPtrmaximumPacketSize ConnectTokenClientStateChangeCallback ClientConfig ClientStateClientState'ConnectTokenExpiredClientState'InvalidConnectTokenClientState'ConnectionTimedOut&ClientState'ConnectionResponseTimedOut%ClientState'ConnectionRequestTimedOutClientState'ConnectionDeniedClientState'Disconnected$ClientState'SendingConnectionRequest%ClientState'SendingConnectionResponseClientState'ConnecteddefaultClientConfigsetClientStateChangeCallbackclearClientStateChangeCallbacksetClientSendReceiveOverridesclearClientSendReceiveOverrides createClient destroyClientgenerateClientID connectClientdisconnectClient updateClientgetClientStateisClientDisconnectednextClientPacketSequencesendPacketFromClientreceivePacketFromServer getClientPortwithClientServerAddressmaximumUserDataSizemaximumServersPerConnectprivateKeySizeServerConnectDisconnectCallback ServerConfigdefaultServerConfig setProtocolID setPrivateKey"setServerConnectDisconnectCallback$clearServerConnectDisconnectCallbacksetServerSendReceiveOverridesclearServerSendReceiveOverrides createServer startServer maxNumClients stopServer destroyServer updateServerclientConnectedAtIndexclientIdAtIndexwithClientAddressAtIndexwithClientUserDataAtIndexclientUserDataAtIndexmaxClientsForServernumConnectedClientsisServerRunning isServerFull getServerPortdisconnectClientFromServerdisconnectAllClientsFromServernextServerPacketSequencesendPacketFromServerbroadcastPacketFromServerreceivePacketFromClientLogLevel LogLevel'None LogLevel'InfoLogLevel'ErrorLogLevel'Debug initialize terminatelogLevelsleep $fEqLogLevel $fOrdLogLevel$fShowLogLevel$fReadLogLevel$fBoundedLogLevel$fEnumLogLevel$fGenericLogLevel$fDataLogLevelbaseGHC.BaseStringtypedAddressModerawAddressModemkSendPacketOverridemkReceivePacketOverride System.IOputStrLn