~ On Apr 30, 4:32 pm, Aaron Leonard wrote: ~ > Hi again, ~ >
~ > ~ I have a Cisco 2610 router (older model, not the XM version) with a ~ > ~ 4- ~ > ~ Port Async/Sync Network Module (NM-4A/S). I'm trying to control a ~ > ~ serial ~ > ~ device through an IP connection to the router. ~ > ~ ~ > ~ I will be sending small messages (about 100 bytes at a time using a ~ > ~ winsock connection) but the frequency of those messages will be faster ~ > ~ than the serial port can handle. For testing, I wrote a small app that ~ > ~ sends a bunch of messages one right after another to HyperTerminal ~ > ~ sitting on the end of the serial Comm port. The result is that the ~ > ~ first message gets there, but the rest are dropped. The winsock send ~ > ~ command thinks that the messages got there and reports no error. If I ~ > ~ add enough delay between messages, then it seems to work OK. ~ > ~ Nothing is returned on the receive end of the socket, even when I ~ > ~ turned on flowcontrol { software} on the line and enabled XON/XOFF on ~ > ~ the HyperTerminal side. ~ > ~ ~ > ~ Is there a way to get some kind of handshake between the Winsock ~ > ~ connection and the serial device? ~ > ~ ~ > ~ Thanks ~ > ~ ~ > ~ Chris Nelson ~ >
~ > Well ... if you're using TCP (stream sockets), then you SHOULD have ~ > a reliable, flow controlled connection between your app and the router. ~ > No data should be lost. ~ >
~ > The router will drain the data arriving on TCP connection at the nominal ~ > bit rate of the async line. Assuming that the device hanging off the ~ > async line can handle all the data arriving at the port speed, then you ~ > should use no data. If that device cannot handle data at the full port ~ > speed, then use software or hardware flowcontrol. ~ >
~ > Are you SURE all the data that your app thinks it's writing, is making ~ > it into the TCP connection? You might use windump/wireshark to do a ~ > capture and verify this. ~ >
~ > Aaron ~ ~ Yes, I have a reliable TCP connection to the router. I also have a ~ reliable device hanging on the async line that can easily handle data ~ at the connected port speed. The problem is that I can pump data into ~ the router from the TCP connection at speeds much faster than the port ~ speed, so something has to give. I was hoping for the router to carry ~ the flow control from the serial device back to the TCP socket client ~ so it can pause until the port is ready to take on more data.
Right, that's the way it's supposed to work. If it doesn't work like this, then that would be a bug.
~ I am using Ethereal as the network analyzing tool. It is a free ~ download and very cool.
Definitely, that's the one (although it's been renamed to Wireshark now.)
Regards,
Aaron