和网络相关,偏底层的处理。
- 事件处理
Update
// update some common properties quickly
set_timeout
// sets timeout based on connection state, so as stale connections are cleared quickly
// if these timeouts are met connection is closed
Exit
// marks connection as exit in progress
IsExitInProgress
Send_Message
Send_Message_prelocked
// used when we have command queue
// assumingin peer lock has already been taken
Read_Data_Frame
// reads our data, length prefix blocks
Handle_Connection
开始从外部网络,过渡到内核。
// handles both server and client connections
Handle_Handshake
Handle_TimedSync
Handle_ChainRequest
Handle_ChainResponse
Handle_ObjectRequest
Handle_ObjectResponse
Handle_Notification_Block
Handle_Notification_Transaction
目前支持的事件处理:
- V2_COMMAND_HANDSHAKE
- V2_COMMAND_SYNC
- V2_COMMAND_CHAIN_REQUEST
- V2_COMMAND_CHAIN_RESPONSE
- V2_COMMAND_OBJECTS_REQUEST
- V2_COMMAND_OBJECTS_RESPONSE
- V2_NOTIFY_NEW_BLOCK
- V2_NOTIFY_NEW_TX