A NetworkEngine acts as your connection or "node" in the network. More...
Extends: | |
Implements: | |
Constants: |
|
Fields: |
|
Constructors: |
|
Properties: |
|
Methods: |
|
Functions: |
|
Inherited Methods: |
|
Inherited Functions: |
|
A NetworkEngine acts as your connection or "node" in the network. At present, a NetworkEngine can be a client or a host. These documents regard "nodes" as abstract entry-points to the network. In other words, clients or hosts, or potentially actual nodes (Peer-to-peer will eventually be looked into).
NetworkEngine objects handle incoming and outgoing messages, client connections, notifications via the "NetworkListener" interfaces, just the protocol in general. They require your application to continually use the official asynchronous call-back routine, UpdateAsyncEvents. The entire framework works using asynchrnous routines, meaning it's portable across targets. There are several situations where asynchronous techniques can be user-defined, but this framework reserves the right to ignore these requests if necessary.
NetworkEngine objects handle the vast majority of what goes on behind the scenes, and they are responsible for the objects they emit. That being said, if an object is allocated via a pool, or similar system, it's up to the user to return the object(s) provided.
Though undocumented, most BRL Socket asynchronous callbacks are implemented, and can be extended when extending this framework. That being said, this framework reserves the right to resolve "Socket" as any type it sees fit. The documentation currently only reflects the BRL implementation.
This specifies if normal messages should be accepted after a client has been told to disconnect.
This acts as the primary connection-socket. This is what all network operations are done with when using UDP; and what client acceptance is done with when using TCP.
This field is protected. To access this externally, use Socket (Use at your own risk).
This represents the maximum number of "mega-packet" chunks allowed. Chunk sizes depend on 'PacketSize' on the other end.
In other words, this is variable, but it should never be larger than the other side's PacketSize.
This stores the amount of time a 'MegaPacket' is allowed to idle.
This is a container of pending (Local; outbound) MegaPacket objects.
This field is protected.
This is a container representing reliable packets in transit.
For more information on reliable packets, and how they work, see AllocateReliablePacket and ReliablePacket.
This field is protected.
For more information on "system packets", see AddSystemPacket.
This field is protected.
This is a proxy to an internal BasicPacketPool object's FixByteOrder property. This corresponds to the 'FixByteOrder' constructor argument.
This counts the number of Clients who are connected to this network, and are not closing/disconnecting.
This states if the network is closed.
Please check for open-status with Open instead of this. Opening networks aren't closed, but they aren't open either. And closing/terminating networks are open, but they aren't closed yet.
See also: Open, Close, CloseAsync
This indicates if there is at least one Client in this network that is not closing/disconnecting.
This always reports True for clients, as Remote will report a Client representing the remote host.
This indicates if there is at least one Client in this network that is closing/disconnecting.
This corresponds with the constructor argument of the same name. Basically, this dictates whether more than one (Client) connection is allowed.
This property has protected assignment-access.
This is a proxy to an internal BasicPacketPool object's PacketSize property. This corresponds to the constructor argument of the same name.
This counts the number of Client handles in the Clients container, without caring about their closing status.
This represents the remote 'host-node' for clients. For hosts, this always reports Null.
This is used to delegate the Connection field. When writing code to extend an engine, don't use this property. Everywhere else (External systems / public extension), use this.
See also: Connection
This represents the transport protocol used by the network.
This property has protected assignment-access.
See also: ProtocolToString
This sends a rejection message regarding a remote MegaPacket with ID, to C with Reason.
In addition to rejecting the MegaPacket, this will call RemoveWaitingMegaPacket on C.
This method is protected.
See also: SendMegaPacketRejection, RemovePendingMegaPacket, GetWaitingMegaPacket
This aborts a MegaPacket, either through a Client, or locally via RemovePendingMegaPacket.
This depends on the FromClient argument, which is used for the protocol, and for proper cleanup.
This method is protected.
See also: SendMegaPacketRejection, RemovePendingMegaPacket, GetWaitingMegaPacket
This adds MP as a local MegaPacket internally. Basically, MP will be held in a container, so it can be referenced by the receiving end using its ID.
This method is protected.
See also: RemovePendingMegaPacket, GetPendingMegaPacket
This is used to manually add a "system packet".
"System packets" are automatically managed Packet objects, that are held for later attainment when their underlying buffer is sent back through an internal callback.
For example, the packet-less overloads for the "LaunchAsync" and "AutoLaunch" internal methods allocate system packets.
If unsure, don't mess with this.
This method is protected.
See also: AllocateSystemPacket, DeallocateSystemPacket, RemoveSystemPacket
This will allocate a MegaPacket object for use within this network.
When finished with this object, please call ReleaseMegaPacket. (Sending does not release a MegaPacket formally)
This allocates and initializes a Packet object for general use, usually from a pool.
This object can be used to read (Requires extension) or write messages. Once finished, you can call Send, or AutoSendRaw, depending on your use-case.
Because this is likely from a pool, please call ReleasePacket when finished with the Packet object you get from this.
This allocates an internal ReliablePacket object as a "system packet".
This is used internally, and should only be messed with if you completely understand it.
ReliablePacket objects are not relevant to reliable transport protocols, like TCP.
If unsure, don't mess with this.
This method is protected.
See also: DeallocateReliablePacket
Like the main overload, this will allocate a ReliablePacket as a "system packet".
Unlike that overload, this will call GetNextReliablePacketID for the packet's reliable identifier (PacketID).
If unsure, don't mess with this.
This method is protected.
See also: DeallocateReliablePacket
This allocates a MegaPacket object for remote representation.
This does not hold the returned object internally, please call AddWaitingMegaPacket
This method is protected.
This is used to allocate a "system packet".
Basically, this will call AllocatePacket, then add it as a "system packet" using AddSystemPacket.
For details on "system packets", please view the AddSystemPacket method's documentation.
If unsure, don't mess with this.
This method is protected.
This is used to launch a technology-independent receival thread/operation, asynchronously. (Depends on underlying socket behavior)
S and P are used to perform this operation, and P will likely be reintegrated into this engine when operations are all finished. In other words, assume P is the property of this network.
Assume Force as an unsafe argument; used internally.
This method is protected.
This works like the main implementation. The only difference being, this will allocate a Packet object automatically, and handle its deconstruction/storage.
Assume Force as an unsafe argument; used internally.
This routine does not work with WebSockets.
This method is protected.
This calls ReleaseWaitingMegaPacket with MP, and uses its Destination instead of an exact Client object provided by the user.
For details on method-behavior, please view that implementation's documentation.
This method is protected.
See also: AllocateMegaPacket, ReleaseWaitingMegaPacket, RemoveWaitingMegaPacket, ReleaseInternalMegaPacket
Use this method at your own risk.
This is used to send a raw packet, unlike Send, which builds a formatted raw packet around the described packet. This doesn't handle formats, it simply sends RawPacket to the default destination. (Clients to host, host to clients) The Async argument is used to toggle asynchronous output; queued, could be slower.
See also: Send
Use this method at your own risk.
This is used to send a raw packet, unlike Send, which builds a formatted raw packet around the described packet. This doesn't handle formats, it simply sends RawPacket to the described destination (C). (Clients must send to hosts, hosts can send to any client) The Async argument is used to toggle asynchronous output; queued, could be slower.
See also: Send
This will bind Connection, using this network.
If Async is disabled, this will return whether the bind operation was successful.
If enabled, this will only return False when an internal error occurs.
Binding is done for UDP hosts, mainly. TCP and UDP clients use "automated connection". This can be done with RawConnect.
This method is protected.
See also: Host, RawConnect
This will use the internal socket to perform a bind operation.
This is used for UDP hosts. For details, see the main overload.
This method is protected.
See also: Host, RawConnect
Used internally; use at your own risk.
This command produces a packet in the appropriate format. This will generate a "system packet", which is handled internally. For details on the DefaultSize' argument, please see WriteMessage.
Internal messages do not serialize their data-segments' lengths.
Used internally; use at your own risk.
This will take the contents of Data, transfer it to RP, as well as write any needed formatting. This allows you to use RP as a normal system-managed packet.
ReliablePacket objects should not be used by TCP networks.
See also: BuildOutputMessage
This will generate a ReliablePacket automatically, then call the primary implementation; the same restrictions apply.
See also: BuildOutputMessage
This command manually closes this network.
The network will automatically send remote connections a final unreliable message describing this action. In the case of TCP (Or similar; reliable transport), this will very likely make it to the other end, disconnecting very gracefully.
When using UDP, this message is somewhat unlikely to make it to the destination(s).
If this description message (INTERNAL_MSG_DISCONNECT) is not received, this client/host will timeout on the other end(s). This means that disconnection will happen regardless, but the elegance of this action is unlikely to be preserved. (Transport differences aside)
To disconnect via a request, and in worst case scenarios, a timeout, use CloseAsync. (Ideal)
This command provides a means of gracefully disconnecting from a remote network. To manually disconnect from a network, use Close.
For clients, this is done through a reliable disconnection notice (INTERNAL_MSG_REQUEST_DISCONNECTION), and assuming closing status. The notice will be sent, then the usual behavior of Closing will be applied; limited message acceptance, eventual timeout/disconnection, etc. Ideally, we'd get a message back, and from there, automatically call Close.
For hosts, this will disconnect every client formally. It will then use the Terminating flag to check if all clients have disconnected. Once they have, the Close command will be called automatically.
This is used internally to automate the process of confirming a reliable packet. This routine is only valid when using unreliable transport protocols, like UDP.
This method is protected.
This is used to create a client network using Address with Protocol. Once a connection has been established, please call Update regularly. When you intend to end the network-session, please call Close or CloseAsync.
This generates a NetworkAddress object from Host and Port, then calls the main implementation using the arguments specified.
See also: Host, Close, CloseAsync
This performs a formal deallocation of RP, including "system packet" management.
The return-value indicates if RP was released to this network. If False, something else is using this object. In this situation, ignore RP, as it isn't relevant to your code anymore.
RP should only be an object previously allocated with AllocateReliablePacket.
For details, view the documentation for that method, and AddSystemPacket.
If unsure, don't mess with this.
This method is protected.
See also: AllocateReliablePacket, ReleaseReliablePacket
This will remove all traces of a "system packet" allocated as one. In addition, this will handle reliable packet symantics if necessary.
The return-value of this command specifies if P is no longer in use, and has been removed. (True if everything worked, and it's now in the main "packet pool")
For details on "system packets", please view the AddSystemPacket and RemoveSystemPacket methods' documentation.
If unsure, don't mess with this.
This method is protected.
This deinitializes mega-packet functionality.
This destructor is protected.
See also: InitMegaPackets
This deinitializes reliable-packet functionality.
This destructor is protected.
See also: InitReliablePackets
This sends a reliable disconnection message to C, then marks C as Closing.
See also: DisconnectAll
This disconnects every connected client from a host.
See also: Disconnect
This force-releases C, sending an unreliable notification; use at your own risk.
This is used internally to generate the internal connection-socket, and close if necessary.
This constructor is protected.
This is used to retrieve a Client object using its address.
Do not keep a long-term handle to this object unless you intend to accept OnClientDisconnected notifications.
See also: ObjectEnumerator
Generally speaking, this should only be called when using TCP; for a general purpose routine, please use the overload accepting a NetworkAddress.
This retrieves a Client object using its socket. (Not recommended)
See also: ObjectEnumerator
This may be used to retrieve the next mega-packet identifier. This will increment an internal ID-counter; use with caution.
This method is protected.
This may be used to retrieve the next reliable-packet identifier. This will increment an internal ID-counter; use with caution.
This method is protected.
This retrieves the MegaPacket object with ID, previously added with AddPendingMegaPacket.
If a MegaPacket couldn't be found, this will return Null.
This method is protected.
See also: AddPendingMegaPacket, RemovePendingMegaPacket
This looks through our ReliablePacket objects still in play, and checks if one of them is actually RawPacket.
If unsure, don't mess with this.
This method is protected.
This returns True if a MegaPacket with the ID specified was found.
This method is protected.
See also: AddPendingMegaPacket, RemovePendingMegaPacket, GetPendingMegaPacket
This is used to host a network on Port using Protocol. Once hosting has started, please call Update regularly. When finished hosting, please call Close or CloseAsync.
See also: Connect, Close, CloseAsync
This is a common internal "startup constructor", called whenever Connect or Host is called. This generates the internal socket via GenerateNativeSocket.
This constructor is protected.
This initializes mega-packet functionality.
This constructor is protected.
See also: DeinitMegaPackets
This initializes reliable-packet functionality. (Pooling, management, etc)
This constructor is protected.
See also: DeinitReliablePackets
This specifies if Callback is in any way a callback internally.
This wraps a call to RawPacket's IsReliable implementation.
This method is protected.
This performs a raw receive operation using S. Where S is "connected" to another end exclusively.
This is a specialized version of AutoLaunchReceive, please use that instead.
This routine does not work with WebSockets.
This method is protected.
See also: AutoLaunchReceive, LaunchAsyncReceiveFrom
Like AutoLaunchReceive, this will initialize a raw receive operation.
This one in particular is for UDP sockets, mainly, and is address-based, using Address as an output object for whoever sends a message.
This routine does not work with WebSockets.
This is a specialized version of AutoLaunchReceive, please use that instead.
This method is protected.
See also: AutoLaunchReceive, LaunchAsyncReceive
This will generate a new NetworkAddress, then call the main implementation. For details, please view that overload's documentation.
This routine does not work with WebSockets.
This method is protected.
See also: AutoLaunchReceive, LaunchAsyncReceive
This performs a raw-connect operation on Connection.
If Async is disabled, this will return whether the connection operation was successful.
Raw connections allow us to establish a transport-level connection, which then means we can apply normal authentication atop it.
This method is protected.
This will use the internal socket to perform a raw connection operation.
This is used by both TCP and UDP clients (Currently). For details, see the main overload.
This method is protected.
This command is used to send completely raw data (RawPacket) when using a connected socket (Connection).
This can be useful, as you can generate an output packet yourself, then send it as you see fit. Use these commands with caution.
In general, you should avoid using this command directly, and instead use AutoSendRaw, as it covers output semantics properly.
This method is protected.
See also: AutoSendRaw, RawSendToAll, Send
This sends a completely raw packet (RawPacket) to Address, assuming the underlying transport method supports this. This works for (UDP) clients when Address is the same as Remote's Address.
In general, you should avoid using this command directly, and instead use AutoSendRaw, as it covers output semantics properly.
This only works properly with UDP sockets.
This method is protected.
See also: AutoSendRaw, RawSendToAll, Send
This command is used to send completely raw data (RawPacket) to every connected Client.
This is only especially useful for hosts; clients will send normally.
In general, you should avoid using this command directly, and instead use AutoSendRaw, as it covers output semantics properly.
This method is protected.
See also: AutoSendRaw, RawSend, Send
This is used internally to receive chunks from "extended packets" (MegaPackets).
This is usually called by ReadMessage, and will call ReadMessageBody when the message is finished.
This method is protected.
See also: ReadMessage, ReadMessageBody
This is called whenever a raw packet is received from a remote node.
This routine handles most of the input portion of the network's protocol.
Basically, this handles everything but handling the standard data-segment of user-level packets. So, any "internal messages" we receive will be read and managed through this method.
If you are using TCP as your underlying protocol, then Source will always be available.
This will catch any StreamError thrown by this routine, and any sub routines, unless running in a debug configuration.
This method is protected.
See also: ReadMessageBody, ReadExtendedPacketChunk
This routine handles safety and callbacks for packet data-segments.
This method is protected.
See also: ReadMessage, ReadExtendedPacketChunk
This is provided for convenience; calls the main implementation using C's Address property.
This method is protected.
This is used to manually release a Client from this network.
This will not disconnect the client, only call OnClientDisconnected, and remote it internally if RemoveInternally is enabled.
This method is protected.
See also: Disconnect, ForceDisconnect, DisconnectAll
This should only be called when using TCP.
In addition, the S must be held by a Client.
This calls the main overload with a Client object holding S.
This method is protected.
See also: Disconnect, ForceDisconnect, DisconnectAll
This releases an internally allocated MegaPacket object; will likely fail for externally allocated objects (Unsafe).
The return-value of this command dictates the release-status of MP.
This should only be called on an object allocated with AllocateMegaPacket.
This does not remove any references to MP.
This method is protected.
See also: AllocateMegaPacket
This should only be called on an object allocated with AllocateMegaPacket.
If you're dealing with specialized MegaPackets (Protected routines), please call ReleasePendingMegaPacket (Or ReleaseWaitingMegaPacket).
This releases a Packet object allocated from AllocatePacket.
Passing an object that was not from AllocatePacket is considered "unsafe", and will result in undefined behavior.
The return-value of this method indicates if the object was accepted. For most cases, just call this without worrying about the return-value.
See also: AllocatePacket
This removes MP (A pending/local MegaPacket) from an internal container, then releases it.
This automatically calls RemovePendingMegaPacket and ReleaseInternalMegaPacket
This method is protected.
See also: AllocateMegaPacket, RemovePendingMegaPacket, ReleaseInternalMegaPacket
This releases all pending (Local) MegaPacket objects.
Calling this is considered unsafe; use at your own risk. This will result in timeouts on receiving ends.
This destructor is protected.
This deallocates the ReliablePacket with the identifier specified (ID).
For details, view the DeallocateReliablePacket method's documentation.
If unsure, don't mess with this.
This method is protected.
This removes MP (A remote MegaPacket) from an internal container in C, then releases it.
This automatically calls RemoveWaitingMegaPacket and ReleaseInternalMegaPacket
This method is protected.
See also: AllocateMegaPacket, RemoveWaitingMegaPacket, ReleaseInternalMegaPacket
This is used to remove one of our pending MegaPacket objects.
For more information, view the AddPendingMegaPacket command.
This method is protected.
See also: AddPendingMegaPacket, GetPendingMegaPacket
This is used to remove one of our pending MegaPacket objects using its ID.
For more information, view the main overload, and the AddPendingMegaPacket command.
This method is protected.
See also: AddPendingMegaPacket, GetPendingMegaPacket
This is called internally to remove a Packet handle previously given to AddSystemPacket.
For details on "system packets", please view that method's documentation.
In the case of automatically allocated "system packets", this should be used instead of DeallocateSystemPacket, if you intend to keep the object yourself. (Like a normal Packet from AllocatePacket)
Or, in the case of custom Packet objects, this provides removal without pooling.
If unsure, don't mess with this.
This method is protected.
See also: AddSystemPacket, AllocateSystemPacket, DeallocateSystemPacket
This find a "system packet" associated with Data, and calls DeallocateSystemPacket on it.
For details on "system packets", view the AddSystemPacket command's documentation.
If unsure, don't mess with this.
This method is protected.
This looks through registered "system packets", checking for the Packet object with the same underlying buffer as Data.
For details on "system packets", view the AddSystemPacket command's documentation.
This method is protected.
This sends a pre-serialized ReliablePacket object.
NOTE: This overload only applies to unreliable transport. (UDP, for example) Transport protocols like TCP do not support this kind of operation, and usage will result in undefined behavior.
All ReliablePackets should contain the entire raw message, including the reliable packet meta-data. This will send RP as a raw packet using its Destination property.
This builds and sends a packet of Type using P as the data-segment, and sends to every connected Client. For hosts, this sends to clients, for clients, this sends to the host.
Please enable Reliable if you intend for the message to always be received, even when using reliable transport.
This builds and sends a packet of Type using P as the data-segment, and sends to C. For hosts, this sends to C, for clients, this will only send to C if it is Remote.
This overload provides an easy to use interface for sending MegaPacket objects. MegaPacket messages are always reliable. When this message is received on the other end, it will be done as a MegaPacket, and passed to your application as a Stream.
This sends a connection message (INTERNAL_MSG_CONNECT) to the default destination (Host). Basically, this is what a client uses to connect to a host network.
This method is protected.
See also: Send, AutoSendRaw
ATTENTION: This routine does not perfectly disconnect Clients objects on its own.
This command should only be called by users for debugging purposes, or in the case of lax disconnection environments.
This is used internally by DisconnectClient, which is the proper way to disconnect a Client from this network.
This will send reliable disconnection messages to all connected clients. The rules applied to SendDisconnect apply here, the difference being that this should only be called by hosts.
See also: ForceDisconnect, DisconnectAll, Disconnect, SendDisconnect, SendForceDisconnect, SendDisconnectionNotice
This overload uses automated destination resolution.
To put it simply, this will send to the host for clients, and send to every client for a server.
By default, like SendForceDisconnect, this is not a reliable message, and may need further management after calling.
If Reliable is enabled, this will send a INTERNAL_MSG_REQUEST_DISCONNECTION message. If it's disabled, INTERNAL_MSG_DISCONNECT will be sent.
See also: ForceDisconnect, DisconnectAll, Disconnect, SendDisconnect, SendForceDisconnect, SendDisconnectToAll
ATTENTION: Use ForceDisconnect instead. The only exception is if you intend to manage C yourself. (Use at your own risk)
The Client specified (C) will be in its original state after calling this. However, this will send an unreliable disconnection-notice to C. Because of this, it is a bad idea to call this and not claim C as closing (Manually). This is completely unmanaged, so it's up to the caller to handle C properly.
Technically, a "force disconnect" is unmanaged, so the best course of action would be to ignore the client everywhere.
There's two ways of doing this, the safe way, and the unsafe way:
See also: ForceDisconnect, DisconnectAll, Disconnect
This acts like the other overload, only it sends to the default destination. This is used internally, and should be avoided by normal users. (Use at your own risk)
See also: ForceDisconnect, DisconnectAll, Disconnect
ATTENTION: This overload is UDP-only; use at your own risk.
This will send a disconnection message to the address specified. (INTERNAL_MSG_DISCONNECT) Since this doesn't rely on Client objects, such behavior is unrelated. If you're using a Client object's address for this, you're "doing it wrong". You should use Disconnect, or ForceDisconnect instead.
Though less ideal, but still a better option than this, is the other overload(s) for this command.
Calling this on a Client object's address will result in partially undefined behavior. The likely outcome is a connection time-out.
This method is protected.
See also: Disconnect, ForceDisconnect, Close, CloseAsync
This acts as a semi-automated send-routine for MessagePacket "chunks". (Sending end only)
This will send P using MP's meta-data.
This method is protected.
This is used to request that the remote end handles the chunks described by MP. (INTERNAL_MSG_MEGA_PACKET_ACTION; MEGA_PACKET_ACTION_REQUEST_CHUNK_LOAD)
The IsTheirPacket argument specifies if this was started as their MegaPacket or ours.
This method is protected.
This is used to request a "chunk" from a MegaPacket established on the other end (MP's Destination). The Link argument specifies the "link" (Chunk) of MP to send. (INTERNAL_MSG_MEGA_PACKET_ACTION; MEGA_PACKET_ACTION_REQUEST_CHUNK)
This method is protected.
This acts as an automated version of the main overload (Receiving end only); uses the internal link-position to keep track of chunks. (Modifies MP by changing the current link) - (INTERNAL_MSG_MEGA_PACKET_ACTION; MEGA_PACKET_ACTION_REQUEST_CHUNK)
If MegaPacket.OnFinalLink reports True before sending, this will still send the final chunk request, but when finishing, it will return False.
This indicates that we have finished sending requests.
This method is protected.
This tells the other end to perform a resize action (Number of chunks) on MP; limited by MaxChunksPerMegaPacket. (INTERNAL_MSG_MEGA_PACKET_ACTION; MEGA_PACKET_ACTION_CHUNK_RESIZE)
This method is protected.
This is used to close a MegaPacket (MP). (INTERNAL_MSG_MEGA_PACKET_RESPONSE; MEGA_PACKET_RESPONSE_CLOSE)
The IsTheirPacket argument specifies if we're closing one of their MegaPackets, or one of ours.
This method is protected.
This is used to confirm a MegaPacket (MP). (INTERNAL_MSG_MEGA_PACKET_RESPONSE; MEGA_PACKET_RESPONSE_ACCEPT)
(Not to be confused with requesting)
This method is protected.
This is used to reject a MegaPacket object. (INTERNAL_MSG_MEGA_PACKET_RESPONSE) Basically, this handles network-output for AbortMegaPacket.
The IsTheirPacket argument specifies if this is an anouncement of one of our MegaPackets being closed prematurely, or one of theirs.
This method is protected.
This works like the main overload, only this one takes a MegaPacket, and uses its meta-data (ID). (INTERNAL_MSG_MEGA_PACKET_RESPONSE)
This method is protected.
This is used to initiate sending a MegaPacket (MP) to C. (INTERNAL_MSG_REQUEST_MEGA_PACKET)
(Not to be confused with confirmation)
This method is protected.
This is used to tell C that we received their reliable packet with ID as its identifier. (INTERNAL_MSG_PACKET_CONFIRM)
This method is protected.
This sends an INTERNAL_MSG_PING "title message" to the default destination.
This overload is primarily for hosts; use at your own risk.
This method is protected.
See also: SendPong
This sends an INTERNAL_MSG_PONG "title message" to the default destination.
This overload is primarily for clients; use at your own risk.
This method is protected.
See also: SendPing
This should only be used for standalone MegaPacket actions. (INTERNAL_MSG_MEGA_PACKET_ACTION) Actions may only be performed on previously established MegaPackets.
This method is protected.
This sends an internal message in name only. This overload uses the default destination for Send. A "title message" is an internal message that only consists of the message's title/internal-type. This is useful for basic messages like connection pings, connections/disconnections, etc.
This method is protected.
See also: Send, AutoSendRaw
This sends a "title message" to C. Normal sending behavior applies here.
For details on "title messages", view the main overload's documentation.
This method is protected.
See also: Send, AutoSendRaw
This sends a "title message" to Address. This only really works for UDP hosts (Or similar).
For details on "title messages", view the main overload's documentation.
This method is protected.
See also: Send, AutoSendRaw
This sends a warning message (INTERNAL_MSG_WARNING) to C. Basically, this is a way for a remote node to tell you that a message was used improperly. For now, these messages are internal, and don't do much. They're mainly a debugging tool.
This method is protected.
See also: Send, AutoSendRaw
This sends Data using the information provided (Info). This is used to automate destination management for MegaPacket objects. This should only be called with MegaPackets that have appropriate meta-data.
This method is protected.
See also: Send
@ Method SendWithMegaPacket:Void(Data:Packet, Info:MegaPacket, Type:MessageType, Reliable:Bool=True, Async:Bool=False, Extended:Bool=False)
Like the main overload, this sends Data using its destination. However, if no destination is supplied, this will send without one.
This method is protected.
See also: Send
This sets every callback handle to Callback.
See also: SetCoreCallback, SetMetaCallback, SetClientCallback, SetMegaPacketCallback
This sets the client callback handle to Callback.
This sets the core callback handle to Callback.
This sets the mega-packet callback handle to Callback.
This sets the meta callback handle to Callback.
This checks if C has timed out. This framework reserves the right to ignore meta-data for this action when needed.
Call this every time when you intend to update details of the network. For example, this routine calls UpdateClients, which handles timeouts.
If the network has yet to be opened, this will do nothing. (Always safe)
See also: UpdateClients
This method's prototype may change at a later date.
This writes a message into Output using Input with Type. When writing raw packets, please call BuildOutputMessage or BuildReliableMessage, instead of calling this directly. This message does not handle the "reliable packet boolean", before this part of the message-segment. That reliable message "header" is expected on some transport protocols, such as UDP. Because of this, please call the proper "build" commands.
If your intent is to write or send a normal user-level packet, use AllocatePacket, Send, and finally ReleasePacket
This method is protected.
See also: BuildOutputMessage, BuildReliableMessage, AllocatePacket, Send, ReleasePacket
This compares X and Y, and returns True if they are equal. (Deep compare)
This returns a string representation of Protocol.
Protocol Type | Output |
---|---|
SOCKET_TYPE_UDP | "UDP" |
SOCKET_TYPE_TCP | "TCP" |