comparison Christie/for.NET.md @ 29:0bd2a99a349e

backup 2021-01-22
author autobackup
date Fri, 22 Jan 2021 00:10:04 +0900
parents 459b9fa6f047
children
comparison
equal deleted inserted replaced
28:36c9c8f982f0 29:0bd2a99a349e
32 java LinkedBlockingQueue<> → C# ~~ConcurrentQueue<>~~ → BlockingCollection<> 32 java LinkedBlockingQueue<> → C# ~~ConcurrentQueue<>~~ → BlockingCollection<>
33 java socket.getInetAddress().getHostName() → C# Dns.GetHostEntry(((IPEndPoint) socket.RemoteEndPoint).Address.ToString()).HostName 33 java socket.getInetAddress().getHostName() → C# Dns.GetHostEntry(((IPEndPoint) socket.RemoteEndPoint).Address.ToString()).HostName
34 java clazz.getName() → C# `type.Name` 34 java clazz.getName() → C# `type.Name`
35 java socket.getInputStream().read() → C# socket.Receive([格納する配列]) (intの長さが返る) 35 java socket.getInputStream().read() → C# socket.Receive([格納する配列]) (intの長さが返る)
36 java ClassNotFoundException → C# TypeLoadException 36 java ClassNotFoundException → C# TypeLoadException
37 java ArrayList<E> → C# List<E>
38
37 39
38 --- 40 ---
39 41
40 ## MessagePackが使用されていたクラス 42 ## MessagePackが使用されていたクラス
41 * MessagePackDataGear 43 * MessagePackDataGear
339 objecy lockObj = new object; 341 objecy lockObj = new object;
340 lock(lockObj) { 342 lock(lockObj) {
341 Moniter.Pulse(lock); 343 Moniter.Pulse(lock);
342 } 344 }
343 ``` 345 ```
346 ---
347 csprojectのStartupObjectでnamespaceを含めた書き方は
348
349 `<StartupObject>Christie_net.AttributeCheck</StartupObject>`
350 のようにドットでつなぐ 
351
352 ---
353 フィールド変数などにつけたattributeは次のように取得できる
354
355 ```c#
356 public class AttributeCheck {
357 [Take] private int num = 0;
358 [Peek] public string name = "riono";
359 [PeekFrom("name")] protected string nextName = "local";
360
361
362 private static void Main(string[] args) {
363 AttributeCheck attributeCheck = new AttributeCheck();
364
365 foreach (var field in attributeCheck.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic
366 | BindingFlags.DeclaredOnly | BindingFlags.Instance)) {
367 foreach (var attribute in field.GetCustomAttributes(false)) {
368 Console.WriteLine(attribute);
369 }
370 }
371 }
372
373 // Result
374 // Christie_net.annotation.Take
375 // Christie_net.annotation.Peek
376 // Christie_net.annotation.PeekFrom
377
378 ```
379 BindingFlagsについては下記を参照
380 https://dobon.net/vb/dotnet/programing/typegetmembers.html
381
344 382
345 --- 383 ---
346 ## TODO 384 ## TODO
347 * annotation → fin 385 * annotation → fin
348 * daemon 386 * daemon
349 * connection → cgm要実装 387 * connection → fin
350 * ChristieDaemon → fin 388 * ChristieDaemon → fin
351 * AcceptThread → cgm要実装 389 * AcceptThread → fin
352 * IncomingTcpConnection → CodeGearManager要実装 390 * IncomingTcpConnection → fin
353 * OutboundTcpConnection → fin 391 * OutboundTcpConnection → fin
354 * ThreadPoolExecutors 実装 392 * ThreadPoolExecutors 実装
393 * Config → toporogyManager作成時に必要?
394 * log4netかNlogのどちらかを使う
355 * codegear 395 * codegear
356 * CodeGear → InputDataGear要実装 396 * CodeGear → fin
357 * InputDataGear 397 * InputDataGear → fin
358 * cgm要実装 398 * CodeGearManager → fin
359 * CodeGearManager 399 * CodeGearExecutor → fin
360 * cg要実装
361 * ThreadPoolExcuter要実装
362 * CodeGearExecutor
363 * cgm要実装
364 * cg要実装
365 * datagear 400 * datagear
366 * command 401 * command
367 * Command → fin 402 * Command → fin
368 * CommandType → fin 403 * CommandType → fin
369 * CommandBuilder → fin 404 * CommandBuilder → fin
370 * TakeCommand → CodeGear要実装 405 * TakeCommand → fin
371 * その他のcommand → fin 406 * その他のcommand → fin
372 * dg → fin 407 * dg → fin
373 * DataGearManager → fin 408 * DataGearManager → fin
374 * DataGears → fin 409 * DataGears → fin
375 * WaitList → fin 410 * WaitList → fin