這里客戶端并不是“頭信息”和“請求數(shù)據(jù)”一起發(fā)發(fā)送,而是分兩次發(fā)送。
先發(fā)如下的頭信息,然后才發(fā)送請求的服務和參數(shù):
/**
* Write the connection header - this is sent when connection is established
* +----------------------------------+
* | "hrpc" 4 bytes |
* +----------------------------------+
* | Version (1 byte) |
* +----------------------------------+
* | Service Class (1 byte) |
* +----------------------------------+
* | AuthProtocol (1 byte) |
* +----------------------------------+
*/
Client:
客戶端較直接,是普通的i/o調(diào)用。Call,Connection是Client內(nèi)部類。

Serve:
服務端使用的NIO的方式。
1)Serve 在啟動(start函數(shù))的時候,構(gòu)造Listener,Responder,Handler(數(shù)組)Listener 構(gòu)造出Reader(數(shù)組)注釋:構(gòu)造數(shù)組多個為了提升處理能力。2)Serve 構(gòu)造如下幾個線程類分別處理如下對應nio事件Listener:Acceptable Reader:Readable Responder:Writable
