Chapter 3: Connect an IOC to a TCP simulator
Follow the lessons in order; keep the application source for later exercises.
- Configure StreamDevice support and two command records.
- Run a newline-delimited echo server.
- Read replies and observe connection loss and recovery.
Chapter exercises
- Perform the simulator stop and restart exercise in lesson 3.3. Distinguish the last reply value from the command record’s alarm.
- In the
drvAsynIPPortConfigureline ofst.cmd, change9399to an unused port. Restart the IOC and inspect the connection and write errors. Restore9399and confirm a successful round trip. - Explain which protocol writes
Cmd-RBand why reading an old reply alone does not prove that the device is connected.
Before moving on
-
jeonglee_Demo/retainsdb/training.db,db/training.proto, andiocBoot/iocB46_182-jeonglee_Demo/st.cmdset to port9399. -
jeonglee_Demo/simulator/retains executabletcpserver.bashandconnection_handler.shscripts for Chapters 4 and 6. - The
jeonglee_DemoIOC is stopped withexitandtcpserver.bashis stopped with Ctrl+C. -
ss -ltn 'sport = :9399'reports no active TCP listener.