我使用 JPOS 发送和接收 ISO 8583 消息。这是客户:
public static void main(String[] args) throws IOException, ISOException {
System.setProperty("java.net.preferIPv4Stack", "true");
EvnMsg msg = new EvnMsg();
ISO93APackager packager = new ISO93APackager();
msg.setPackager(packager);
msg.setMTI("1804");
msg.setAuditNumber("124125");
ASCIIChannel channel = new ASCIIChannel("Server_IP", PORT, packager);
channel.connect();
channel.send(msg);
channel.receive();
//channel.disconnect();
}
这是服务器:
public static void main(String[] args) throws IOException, ISOException {
ISO93APackager packager = new ISO93APackager();
ServerChannel channel = new ASCIIChannel (packager);
channel.accept(new ServerSocket(PORT));
ISOMsg isoMsg = channel.receive();
System.out.println("Received");
}
服务器收到消息,但问题是位图的值为 -1
那我做错了吗?接收消息的正确方法是什么?