??????Main?????У?????????????MyDriverClient????????????????????????????????????????MyDriverClient?????????????????????????????Receive????????????????????????Receive???????????null????????????????????????????????Close???????????Receive?????????????MyDriverClient?????????γ????????????????????????

1?? begin
2?? begin
3?? begin
1?? 572224
2?? 64186468
3?? 9448434
1?? 568828
2?? 94581343
3?? 7291394
...
1?? 84165615
2?? 26815943
3?? 237878844
1?? 44716345
Error occurred when receive data.


????Java????????C#???????????????????????????????????C#???MyDriver?????Java???????????myDriver????????????????????????

????MyClient???????

??????MyDriver?????MyClient??????????????????????????????????????????Щ?????????????????????????????????????л?????????????????????????????Щ???????????

????MyConnection??????MyClient????????????з????MyDriverClient?????á?MyConnection???????£?

?????? ReconnectInterval?????????????????γ??????????

?????? MyConnection(string[] uris)?????????????MyConnection??????????????uri??

?????? void Open()????????????????Open?????????????????????????????????????????????

?????? IDisposable Subscribe(int queryId?? IMySubscriber subscriber)?????queryId?????????subscriber???????????queryId??????????????÷??????????IDisposable????Dispose??????????subscriber???????????????queryId??????int?????????????????????????

?????? void Close()?????????????????????????MyDriverClient??Close?????????÷??????????????????ж????????????????Open???????????subscriber?????????????????

?????? Connected???????????????????????

?????? ConnectFailed????????????????????????

?????? Disconnected??????????????????

??????MyDriverClient?????????????????????????MyConnection????????????????????????????????????????磺

?????? ????Open????????????????????????????uri????????????????????????????????uri??????????uri?????????3???????uri?????????????γ??????????????????ReconnectInterval????

?????? MyConnection?????????????????MyDriverClient??Receive??????????????MyDriverException????????????MyDriverClient?????????????????????????????uri???????????????????????????????????????????????????????subscriber?????????

????IMySubscriber??????????????????????????

?????? void OnBegin()????MyDriverClient??Receive???????begin?????????????????????

?????? void OnMessage(string message)????MyDriverClient??Receive???????????????????????????????

???????????MyConnection??????????????????????MyDriverClient??Receive?????????????????MyData????????QueryID??????????subscriber?С?????????????????????????????????????????????????????Subscribe???????????δ?????????????????????????subscriber??????????????????????????????????????AddQuery????????Subscribe?????????????????????????????Dispose????????????????????MyDriverClient??RemoveQuery??????????

????Java?????C#??????Щ??????????????Java????????????????????????巽?????????Closeable????????IDisposable????

??????????

????????????????GitHub?У????Practices01??C#??Java???С???????Fork????????????????????????????????????????????Repository?У??????????????????????????????????????????????

????MyClient????????????????????????????????ò?????????????TDD????????????????????????С????????????????????????????????????????Щ?????????????????????绹??е???MyDriverClient??Connect???????AddQuery???????????????????Open??????????????е???÷??????????????????????????????????????????????á???????????????????????????????????????????????????????????????

???????д???????????????????????????Mock?????????????????Mock????????????????????д????????????????????TypeMock??Moles????PowerMock??????????????Mock??????????final???????????к????????????????????????????????????????????????????????Moq????EasyMock???????????

????????????κη?????????????????????κβ?????????????????????????????????????????????λ??????????????????????????????饗????????????????????????л??