How hosung98/bank_tcp_exam works
This is a bank-protocol TCP simulator project, with byte encoding, length-prefixed framing, shared telegram fields, transaction messages, and simulator-side dispatch. The shown handler implements the receive–dispatch–reply workflow. The README also describes a client, polling, deposits, cancellation, and push notifications, but those modules are absent from the supplied tree and its package layout differs; they are not represented as implemented components. Source excerpts are limited, so unshown runtime connections are omitted.
Main entry points: BankSimulatorHandler.java Telegram dispatcher · ExtraHeader.java Extra header · BankSimulatorServer.java Simulator server · CommonHeader.java Common header
Components 15
Transport and dispatch
- Telegram dispatcher
BankSimulatorHandler.java - Simulator server
src/main/java/com/example/bank_tcp_exam/simulator/BankSimulatorServer.java - Length framer
src/main/java/com/example/bank_tcp_exam/framing/LengthPrefixedFramer.java
Telegram protocol
- Byte codec
src/main/java/com/example/bank_tcp_exam/codec/ByteCodec.java - Common header
src/main/java/com/example/bank_tcp_exam/protocol/common/CommonHeader.java - Extra header
src/main/java/com/example/bank_tcp_exam/protocol/common/ExtraHeader.java - Telegram trailer
src/main/java/com/example/bank_tcp_exam/protocol/common/TelegramTrailer.java
Transaction handling
- Polling messages
src/main/java/com/example/bank_tcp_exam/protocol/tx/c0001 - Deposit messages
src/main/java/com/example/bank_tcp_exam/protocol/tx/c2001 - Polling handler
src/main/java/com/example/bank_tcp_exam/simulator/handler/C0001_Handler.java - Deposit handler
src/main/java/com/example/bank_tcp_exam/simulator/handler/C2001_Handler.java - Handler contract
src/main/java/com/example/bank_tcp_exam/simulator/handler/SimulatorTxHandler.java
Other components
- Institution client
- Bank peer
- Application entry
src/main/java/com/example/bank_tcp_exam/BankTcpExamApplication.java
Connections 14
- Institution client → Simulator server: sends telegrams
- Telegram dispatcher → Length framer: reads and writes
BankSimulatorHandler.java - Telegram dispatcher → Byte codec: decodes code
BankSimulatorHandler.java - Telegram dispatcher → Handler contract: dispatches to
BankSimulatorHandler.java - Simulator server → Telegram dispatcher: handles telegrams
- Bank peer → Simulator server: simulated peer
README.md - Common header → Extra header: precedes
README.md - Extra header → Telegram trailer: telegram layout
README.md - Polling messages → Common header: uses layout
README.md - Polling messages → Extra header: uses layout
README.md - Deposit messages → Common header: uses layout
README.md - Deposit messages → Extra header: uses layout
README.md - Polling handler → Handler contract: implements
- Deposit handler → Handler contract: implements