我正在尝试通过套接字发送 Iso8583 消息,但我使用的代码似乎只是挂起!
string NewISOmsg = iso8583.Build(DE, MTI);
// Send Message
byte[] data = new byte[1024];
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("66.147.172.198"), 6181);
Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
data = Encoding.ASCII.GetBytes(NewISOmsg);
server.SendTo(data, data.Length, SocketFlags.None, ipep);
IPEndPoint theSender = new IPEndPoint(IPAddress.Parse("66.147.172.198"), 6181);
EndPoint tmpRemote = (EndPoint)theSender;
int recv = server.ReceiveFrom(data, ref tmpRemote);
string ourResponse = tmpRemote.ToString();
server.Close();
// Output response
Response.Write(ourResponse);
我错过了什么?谢谢,本