views:

137

answers:

2

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 between 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).

+1  A: 

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

tommieb75
Unfortunately this is not telling me anything about how to interact with the stream. I understand the conversion and I understand how to read the bytes, what I need to know is how to interpret the bytes as the reflect the screen being sent to the client.
Justin
+4  A: 

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.

dmc
I kinda have to create my own telnet client. I looked over the ehllapi and that is just another piece of software to run. The idea is I have a webservice which broadcasts the bytes form our telnet connections allowing clients from anywhere to connect to the 400. The client would establish a connection to the webservice, the webserice would talk directly to the 400 and send the response to the client.
Justin
I've been looking at the Source Forge project, very helpful. Thank you! Even tho its a lot of code to look through.
Justin
@Justin: Well, 5250 is a complex beast of a protocol. Hey, it's IBM, what did you expect from a company that makes an IDE that takes longer to boot than the PC it's running on?
Jörg W Mittag
True, the stream itself does seem to be simple to translate, but I just started so I assume its going to get much worse.
Justin
I was able to log out the streams to start poking in the right direction. Thank you!
Justin