I am attempting to create a telnet client that I can use to transfer green screen RPGLE apps to fancier client applications. I am able to establish a sockets connection and I have sent in a default "enter" command to access the log in screen but I don't know where to began to interpret where the fields are, where the server id of the session is stored, how to send back a comment, and how to identify the type of field. Does anyone know some good decent documentation that describes the communication betwe开发者_运维问答en the telnet client and its server? I've tried looking online with no avail.
I am writing this using the Microsoft Visual Studio 2010 (vb.net).
You might find the free TN5250 terminal emulator useful in your quest. Check out the developer resources on the Sourceforge link below. Worst case, you could peruse the source code to see how they're decoding the 5250 data stream.
http://tn5250.sourceforge.net/
You might also consider piggy-backing on top of an existing terminal emulator, such as the 5250 emulator that comes with IBM Client Access. Then you'd use EHLLAPI to communicate with and manipulate the terminal emulator from your code. The benefit here is that you wouldn't have to implement a terminal emulator from scratch. Note, however, that if you use Client Access you need to consider licensing. (see related question)
Check out IBM's EHLLAPI FAQ for more info.
The one thing you need to be careful of when dealing with this is the endian-ness of the order of data coming from the mainframe system and also EBCDIC encoding... something to bear in mind when dealing with a platform that is non-ascii and non-unicode, along with the bit order is reversed, on x86 platforms the msb is the order, other platforms its lsb, Most Significant Bit and Least Significant Bit respectively.
By the sound of the task - that is quite a high challenge in itself, are you sure you can do this... perhaps look at open-source code lying around might give you a huge leg up to achieve what you're trying to do... screen-scraping is the key here...
Perhaps this might help you...and here an account of it using python
精彩评论