C# Класс P2PStateServer.GetTransferMessage

Represents the GetTransferMessage message
The GetTransferMessage is broadcast to all connected peers when a peer wishes to receive a session resource from the network. The message is in turn forwarded to other peers that receive the message until tthe message traverses the network. If a peer receives this message and has the requested session resource, it proceeds to transfer the session resource to the peer that originated the broadcast. This message is only transmitted between peers.
Наследование: PeerMessage
Показать файл Открыть проект

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

Метод Описание
Broadcast ( string OriginHost, List sockets, StateServer Service, string SessionKey, System.Guid MessageID, int MaxForwards, System.Guid BroadcastID ) : void

Sends a GetTransferMessage to a list of ServiceSockets

Broadcast ( string OriginHost, List sockets, StateServer Service, string SessionKey, System.Guid MessageID, int MaxForwards, System.Guid BroadcastID, System.DateTime TimeoutStamp, Action FoundAction, System TimeoutAction ) : void

Sends a GetTransferMessage to a list of ServiceSockets and queues an Action to be called if the requested session is transferred to this peer, and another Action to be called if no session is transferred after a set time.

Equals ( object obj ) : bool
Forward ( ) : void

Forwards this message to other peers on the network

GetHashCode ( ) : int
GetTransferMessage ( HTTPPartialData Data, StateServer Service ) : System

Initializes a new instance of the GetTransferMessage class

Process ( ) : void

Process the message

Rebroadcast ( ) : void

Rebroadcasts this message across the network. Rebroadcasts are different from Forwards because they have a different broadcast id and are also sent to the originating peer

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

Метод Описание
CallExportEndedActions ( List Actions ) : void

Calls a list of Actions waiting to be processed after a session transfer is complete

CompleteTransferRequest ( ISessionObject Session, object StateObject ) : void

Called by the SessionDictionary.BeginExport method to complete processing the request, if the requested session was found and read

GetMergedHashCode ( System.Guid MessageID, System.Guid BroadcastID ) : int

Gets a hashcode value based on the combination of the message's ID and RebroadcastID

TransferFailure ( AsyncMessageTracker transferredMessage ) : void

Ends a failed Session Transfer

TransferSuccess ( AsyncMessageTracker transferredMessage ) : void

Ends a successful session transfer

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

Broadcast() публичный статический Метод

Sends a GetTransferMessage to a list of ServiceSockets
public static Broadcast ( string OriginHost, List sockets, StateServer Service, string SessionKey, System.Guid MessageID, int MaxForwards, System.Guid BroadcastID ) : void
OriginHost string The Host name of the peer that originally initiated this message
sockets List List of target ServiceSockets
Service StateServer Instance of state server
SessionKey string The requested session URI
MessageID System.Guid The unique message identifier
MaxForwards int The maximum number of nodes to forward the message to. This field is decremented by one for each forward
BroadcastID System.Guid The broadcast identifier. Used by peers to identify different broadcasts of the same message.
Результат void

Broadcast() публичный статический Метод

Sends a GetTransferMessage to a list of ServiceSockets and queues an Action to be called if the requested session is transferred to this peer, and another Action to be called if no session is transferred after a set time.
public static Broadcast ( string OriginHost, List sockets, StateServer Service, string SessionKey, System.Guid MessageID, int MaxForwards, System.Guid BroadcastID, System.DateTime TimeoutStamp, Action FoundAction, System TimeoutAction ) : void
OriginHost string The Host name of the peer that originally initiated this message
sockets List List of target ServiceSockets
Service StateServer Instance of state server
SessionKey string The requested session URI
MessageID System.Guid The unique message identifier
MaxForwards int The maximum number of nodes to forward the message to. This field is decremented by one for each forward
BroadcastID System.Guid The broadcast identifier. Used by peers to identify different broadcasts of the same message
TimeoutStamp System.DateTime The Time in UTC, at which point the message query is considered timed out
FoundAction Action The Action to be called if the requested session is transferred to this peer
TimeoutAction System The Action to be called if the requested session is not transferred to this peer after the TimeoutStamp time
Результат void

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

public Equals ( object obj ) : bool
obj object
Результат bool

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

Forwards this message to other peers on the network
public Forward ( ) : void
Результат void

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

public GetHashCode ( ) : int
Результат int

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

Initializes a new instance of the GetTransferMessage class
public GetTransferMessage ( HTTPPartialData Data, StateServer Service ) : System
Data HTTPPartialData The HTTPPartialData class to load this instance from
Service StateServer State server instance
Результат System

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

Process the message
public Process ( ) : void
Результат void

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

Rebroadcasts this message across the network. Rebroadcasts are different from Forwards because they have a different broadcast id and are also sent to the originating peer
public Rebroadcast ( ) : void
Результат void