|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Using SerialPort With DialUpNetworking Protocol?My .Net 2 application filters serial communications data and i/o by sitting between a virtual serial port (www.eltima.com) and the .Net 2 SerialPort class. It is regularly trying to transfer settings, data, and events back and forth between the two. Until I tried running Dial Up Networking across this mechanism, I was doing pretty well. But I can never get a dial up networking connection to work (never gets past trying to authenticate the user). So I have been using Portmon (www.sysinternals.com) to watch what happens when dial up networking fails using my mechanism versus what happens when dial up networking succeeds talking directly to a modem's com port. Until the point of connection with the remote system, things look pretty similar. But at that point, I note the following under the failing circumstance: (a) The read interval timeout on the virtual port is set to -1. The other read timeout components are 0. (b) The event character in the virtual port is set to 126 (~). (c) Dial up networking begins to send data to the virtual port which starts and ends with ~. It appears to send the same data a few times in a row (with only minor variation on each send - the values that do change in the data go up by 1 with each send - I presume this is a retry count of some sort). In the successful session (direct to the modem), after the first send, the remote system returns a shorter but similar looking set of data (again begins and ends with ~). However, on the failing session, this data never comes and ultimately, only a textual login prompt is sent by the remote system (same as I get dialing the number with Hyperterminal). In the docs for the SetCommTimeouts API, there is a note about special behaviors when some of the read timeout values are set to MAXDWORD (int = -1). So the change in the read interval timeout to -1 may have something to do with my problems. But I am not clear what, if anything, I can do to the SerialPort instance to encourage it to behave in the way dial up networking is requesting. Also, the event character is clearly being changed and used by the dial up networking protocol. But I see no may to tell the SerialPort class to use this event character (or eof character for that matter). So I believe that this too may be part of the problem. Anyone have a suggestion about how to proceed? Perhaps somehow using the BaseStream? I am rather new to all this. Perhaps the SerialPort class is just not up to this task (although I suspect I am more to blame here). Thanks! |
|||||||||||||||||||||||