C# Класс Fun.FunapiNetwork

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AttachTransport ( FunapiTransport transport ) : void
Connect ( TransportProtocol protocol, FunEncoding type, Fun.HostAddr addr ) : bool
CreateFunMessage ( object msg, MessageType msg_type ) : FunMessage
DetachTransport ( TransportProtocol protocol ) : void
FunapiNetwork ( bool session_reliability = false ) : UnityEngine
GetDefaultProtocol ( ) : TransportProtocol
GetEncoding ( TransportProtocol protocol ) : FunEncoding
GetMessage ( FunMessage msg, MessageType msg_type ) : object
GetMessageProtocol ( string msg_type ) : TransportProtocol
GetTransport ( TransportProtocol protocol ) : FunapiTransport
HasTransport ( TransportProtocol protocol ) : bool
LastErrorCode ( TransportProtocol protocol ) : ErrorCode
LastErrorMessage ( TransportProtocol protocol ) : string
Reconnect ( TransportProtocol protocol ) : bool
Redirect ( TransportProtocol protocol, Fun.HostAddr addr, bool keep_session_id = false ) : bool
RegisterHandler ( string type, MessageEventHandler handler ) : void
RegisterHandlerWithProtocol ( string type, TransportProtocol protocol, MessageEventHandler handler ) : void
SendMessage ( MessageType msg_type, object message, EncryptionType encryption = EncryptionType.kDefaultEncryption, TransportProtocol protocol = TransportProtocol.kDefault, string expected_reply_type = null, float expected_reply_time = 0f, TimeoutEventHandler onReplyMissed = null ) : void
SendMessage ( MessageType msg_type, object message, string expected_reply_type, float expected_reply_time, TimeoutEventHandler onReplyMissed ) : void
SendMessage ( string msg_type, object message, EncryptionType encryption = EncryptionType.kDefaultEncryption, TransportProtocol protocol = TransportProtocol.kDefault, string expected_reply_type = null, float expected_reply_time = 0f, TimeoutEventHandler onReplyMissed = null ) : void
SendMessage ( string msg_type, object message, string expected_reply_type, float expected_reply_time, TimeoutEventHandler onReplyMissed ) : void
SetDefaultProtocol ( TransportProtocol protocol ) : void
SetMessageProtocol ( TransportProtocol protocol, string msg_type ) : void
Start ( ) : void
StartTransport ( TransportProtocol protocol ) : void
Stop ( bool clear_all = true ) : void
StopTransport ( TransportProtocol protocol ) : void
Update ( ) : void

Приватные методы

Метод Описание
AddExpectedReply ( FunapiMessage fun_msg, string reply_type, float reply_time, TimeoutEventHandler onReplyMissed ) : void
CheckTransportConnection ( TransportProtocol protocol ) : void
CloseSession ( ) : void
DeleteExpectedReply ( string reply_type ) : void
FindOtherTransport ( TransportProtocol protocol ) : FunapiTransport
InitSession ( ) : void
OnAckReceived ( FunapiTransport transport, UInt32 ack ) : void
OnClientPingMessage ( FunapiTransport transport, object body ) : void
OnConnectTimeout ( TransportProtocol protocol ) : void
OnMaintenanceMessage ( string msg_type, object body ) : void
OnNewSession ( string msg_type, object body ) : void
OnPingTimerEvent ( object param ) : void
OnSeqReceived ( FunapiTransport transport, UInt32 seq ) : bool
OnServerPingMessage ( FunapiTransport transport, object body ) : void
OnSessionTimedout ( string msg_type, object body ) : void
OnStoppedAllTransportCallback ( ) : void
OnTransportConnectFailure ( TransportProtocol protocol ) : void
OnTransportDisconnected ( TransportProtocol protocol ) : void
OnTransportFailure ( TransportProtocol protocol, FunapiMessage fun_msg ) : void
OnTransportReceived ( TransportProtocol protocol, string>.Dictionary header, ArraySegment body ) : void
OnTransportStarted ( TransportProtocol protocol ) : void
OnTransportStopped ( TransportProtocol protocol ) : void
OpenSession ( string session_id ) : void
PrepareSession ( string session_id ) : void
ProcessMessage ( TransportProtocol protocol, ArraySegment buffer ) : void
SendAck ( FunapiTransport transport, UInt32 ack ) : void
SendEmptyMessage ( TransportProtocol protocol ) : void
SendPingMessage ( FunapiTransport transport ) : void
SendUnsentMessages ( ) : void
SeqLess ( UInt32 x, UInt32 y ) : bool
SetTransportStarted ( FunapiTransport transport, bool send_unsent = true ) : void
StartPingTimer ( FunapiTransport transport ) : void
StartTransport ( FunapiTransport transport ) : void
StopPingTimer ( FunapiTransport transport ) : void
StopTransport ( FunapiTransport transport ) : void

Описание методов

AttachTransport() публичный Метод

public AttachTransport ( FunapiTransport transport ) : void
transport FunapiTransport
Результат void

Connect() публичный Метод

public Connect ( TransportProtocol protocol, FunEncoding type, Fun.HostAddr addr ) : bool
protocol TransportProtocol
type FunEncoding
addr Fun.HostAddr
Результат bool

CreateFunMessage() публичный Метод

public CreateFunMessage ( object msg, MessageType msg_type ) : FunMessage
msg object
msg_type MessageType
Результат FunMessage

DetachTransport() публичный Метод

public DetachTransport ( TransportProtocol protocol ) : void
protocol TransportProtocol
Результат void

FunapiNetwork() публичный Метод

public FunapiNetwork ( bool session_reliability = false ) : UnityEngine
session_reliability bool
Результат UnityEngine

GetDefaultProtocol() публичный Метод

public GetDefaultProtocol ( ) : TransportProtocol
Результат TransportProtocol

GetEncoding() публичный Метод

public GetEncoding ( TransportProtocol protocol ) : FunEncoding
protocol TransportProtocol
Результат FunEncoding

GetMessage() публичный Метод

public GetMessage ( FunMessage msg, MessageType msg_type ) : object
msg FunMessage
msg_type MessageType
Результат object

GetMessageProtocol() публичный Метод

public GetMessageProtocol ( string msg_type ) : TransportProtocol
msg_type string
Результат TransportProtocol

GetTransport() публичный Метод

public GetTransport ( TransportProtocol protocol ) : FunapiTransport
protocol TransportProtocol
Результат FunapiTransport

HasTransport() публичный Метод

public HasTransport ( TransportProtocol protocol ) : bool
protocol TransportProtocol
Результат bool

LastErrorCode() публичный Метод

public LastErrorCode ( TransportProtocol protocol ) : ErrorCode
protocol TransportProtocol
Результат ErrorCode

LastErrorMessage() публичный Метод

public LastErrorMessage ( TransportProtocol protocol ) : string
protocol TransportProtocol
Результат string

Reconnect() публичный Метод

public Reconnect ( TransportProtocol protocol ) : bool
protocol TransportProtocol
Результат bool

Redirect() публичный Метод

public Redirect ( TransportProtocol protocol, Fun.HostAddr addr, bool keep_session_id = false ) : bool
protocol TransportProtocol
addr Fun.HostAddr
keep_session_id bool
Результат bool

RegisterHandler() публичный Метод

public RegisterHandler ( string type, MessageEventHandler handler ) : void
type string
handler MessageEventHandler
Результат void

RegisterHandlerWithProtocol() публичный Метод

public RegisterHandlerWithProtocol ( string type, TransportProtocol protocol, MessageEventHandler handler ) : void
type string
protocol TransportProtocol
handler MessageEventHandler
Результат void

SendMessage() публичный Метод

public SendMessage ( MessageType msg_type, object message, EncryptionType encryption = EncryptionType.kDefaultEncryption, TransportProtocol protocol = TransportProtocol.kDefault, string expected_reply_type = null, float expected_reply_time = 0f, TimeoutEventHandler onReplyMissed = null ) : void
msg_type MessageType
message object
encryption EncryptionType
protocol TransportProtocol
expected_reply_type string
expected_reply_time float
onReplyMissed TimeoutEventHandler
Результат void

SendMessage() публичный Метод

public SendMessage ( MessageType msg_type, object message, string expected_reply_type, float expected_reply_time, TimeoutEventHandler onReplyMissed ) : void
msg_type MessageType
message object
expected_reply_type string
expected_reply_time float
onReplyMissed TimeoutEventHandler
Результат void

SendMessage() публичный Метод

public SendMessage ( string msg_type, object message, EncryptionType encryption = EncryptionType.kDefaultEncryption, TransportProtocol protocol = TransportProtocol.kDefault, string expected_reply_type = null, float expected_reply_time = 0f, TimeoutEventHandler onReplyMissed = null ) : void
msg_type string
message object
encryption EncryptionType
protocol TransportProtocol
expected_reply_type string
expected_reply_time float
onReplyMissed TimeoutEventHandler
Результат void

SendMessage() публичный Метод

public SendMessage ( string msg_type, object message, string expected_reply_type, float expected_reply_time, TimeoutEventHandler onReplyMissed ) : void
msg_type string
message object
expected_reply_type string
expected_reply_time float
onReplyMissed TimeoutEventHandler
Результат void

SetDefaultProtocol() публичный Метод

public SetDefaultProtocol ( TransportProtocol protocol ) : void
protocol TransportProtocol
Результат void

SetMessageProtocol() публичный Метод

public SetMessageProtocol ( TransportProtocol protocol, string msg_type ) : void
protocol TransportProtocol
msg_type string
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

StartTransport() публичный Метод

public StartTransport ( TransportProtocol protocol ) : void
protocol TransportProtocol
Результат void

Stop() публичный Метод

public Stop ( bool clear_all = true ) : void
clear_all bool
Результат void

StopTransport() публичный Метод

public StopTransport ( TransportProtocol protocol ) : void
protocol TransportProtocol
Результат void

Update() публичный Метод

public Update ( ) : void
Результат void