C# Class Fun.FunapiNetwork

ファイルを表示 Open project: iFunFactory/demo-kgc-2015 Class Usage Examples

Public Methods

Method Description
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

Private Methods

Method Description
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

Method Details

AttachTransport() public method

public AttachTransport ( FunapiTransport transport ) : void
transport FunapiTransport
return void

Connect() public method

public Connect ( TransportProtocol protocol, FunEncoding type, Fun.HostAddr addr ) : bool
protocol TransportProtocol
type FunEncoding
addr Fun.HostAddr
return bool

CreateFunMessage() public method

public CreateFunMessage ( object msg, MessageType msg_type ) : FunMessage
msg object
msg_type MessageType
return FunMessage

DetachTransport() public method

public DetachTransport ( TransportProtocol protocol ) : void
protocol TransportProtocol
return void

FunapiNetwork() public method

public FunapiNetwork ( bool session_reliability = false ) : UnityEngine
session_reliability bool
return UnityEngine

GetDefaultProtocol() public method

public GetDefaultProtocol ( ) : TransportProtocol
return TransportProtocol

GetEncoding() public method

public GetEncoding ( TransportProtocol protocol ) : FunEncoding
protocol TransportProtocol
return FunEncoding

GetMessage() public method

public GetMessage ( FunMessage msg, MessageType msg_type ) : object
msg FunMessage
msg_type MessageType
return object

GetMessageProtocol() public method

public GetMessageProtocol ( string msg_type ) : TransportProtocol
msg_type string
return TransportProtocol

GetTransport() public method

public GetTransport ( TransportProtocol protocol ) : FunapiTransport
protocol TransportProtocol
return FunapiTransport

HasTransport() public method

public HasTransport ( TransportProtocol protocol ) : bool
protocol TransportProtocol
return bool

LastErrorCode() public method

public LastErrorCode ( TransportProtocol protocol ) : ErrorCode
protocol TransportProtocol
return ErrorCode

LastErrorMessage() public method

public LastErrorMessage ( TransportProtocol protocol ) : string
protocol TransportProtocol
return string

Reconnect() public method

public Reconnect ( TransportProtocol protocol ) : bool
protocol TransportProtocol
return bool

Redirect() public method

public Redirect ( TransportProtocol protocol, Fun.HostAddr addr, bool keep_session_id = false ) : bool
protocol TransportProtocol
addr Fun.HostAddr
keep_session_id bool
return bool

RegisterHandler() public method

public RegisterHandler ( string type, MessageEventHandler handler ) : void
type string
handler MessageEventHandler
return void

RegisterHandlerWithProtocol() public method

public RegisterHandlerWithProtocol ( string type, TransportProtocol protocol, MessageEventHandler handler ) : void
type string
protocol TransportProtocol
handler MessageEventHandler
return void

SendMessage() public method

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
return void

SendMessage() public method

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
return void

SendMessage() public method

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
return void

SendMessage() public method

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
return void

SetDefaultProtocol() public method

public SetDefaultProtocol ( TransportProtocol protocol ) : void
protocol TransportProtocol
return void

SetMessageProtocol() public method

public SetMessageProtocol ( TransportProtocol protocol, string msg_type ) : void
protocol TransportProtocol
msg_type string
return void

Start() public method

public Start ( ) : void
return void

StartTransport() public method

public StartTransport ( TransportProtocol protocol ) : void
protocol TransportProtocol
return void

Stop() public method

public Stop ( bool clear_all = true ) : void
clear_all bool
return void

StopTransport() public method

public StopTransport ( TransportProtocol protocol ) : void
protocol TransportProtocol
return void

Update() public method

public Update ( ) : void
return void