将数据发送到TCP端口 [英] Sending data to TCP port
问题描述
我正在编写一个现金注册程序,需要将数据发送到卡终端进行付款。
在计算机上运行一个处理通信的程序与终端。这个程序正在通过TCP端口12555进行监听.Al程序在一台计算机上运行。
所以我需要将数据发送到TCP端口12555并等待答案。
ex。:
TR 3900 = TR是突击队,3900 = 39.00€
回答:
200 =交易OK
400 =交易被拒绝
....
any建议?
thnx
Marc Cuyt
Dodentocht Bornem
Hi,
I'm writing a cashregister program that needs to send data to a card terminal to make payments.
On the computer runs a program that handles communication with the terminal. This program is listening through TCP port 12555. Al the programs run on one computer.
So i need to send data to TCP port 12555 and wait for the answer.
ex.:
TR 3900 = TR is commando, 3900 = 39.00€
answer:
200 = transaction OK
400 = transaction refused
....
any suggestions ?
thnx
Marc Cuyt
Dodentocht Bornem
推荐答案
你有为TCP comm编写一个简单的客户端程序。
互联网 [ ^ ],它不值得添加更多。
也许你想用这个类 [ ^ ],并使用其示例客户端界面快速检查连接...
You have to write a simple client program for TCP comm.
There is a plenty of samples on the internet[^], that it's unworth to add more.
Maybe you want use this class[^] from CodeProject in your software, and use its sample client interface to make a fast check on the connection...
这篇关于将数据发送到TCP端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!