home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / protocol / tcpip / 6059 < prev    next >
Encoding:
Text File  |  1993-01-23  |  2.9 KB  |  74 lines

  1. Newsgroups: comp.protocols.tcp-ip
  2. Path: sparky!uunet!csfb1!jswanson
  3. From: jswanson@csfb1.fir.fbc.com (James Swanson)
  4. Subject: Re: Help with termcap/terminfo needed 
  5. Message-ID: <C19q5J.Btt@csfb1.fir.fbc.com>
  6. Sender: news@csfb1.fir.fbc.com (Usenet News Account)
  7. Reply-To: uunet!csfb1!jswanson
  8. Organization: First Boston Corporation
  9. Date: Fri, 22 Jan 1993 18:32:07 GMT
  10. Lines: 62
  11.  
  12. |> I have an application running on 2 different flavours of Unix.  The applicati
  13. on
  14. |> uses function keys F1 to F4.  The are defined as generating ESC-@ ESC-A ESC-B
  15. |> ESC-C.  On one system they are passed in to the application as the appropriat
  16. e
  17. |> function keys and on the other arrive separately as ESC and then @/B/C etc.
  18. |> All the terminal definitions are exactly the same.
  19. |> This looks like a timing problem.  Is there a code that can be modified to
  20. |> fix this or is my problem somewhere else ? (Like in the application which is
  21. |> Informix and about which I know sweet **??!!)
  22. |>
  23. |> AdvThx
  24. |>
  25. |> --
  26. |> Jo Baker, D9                        |email: jo@siesoft.co.uk
  27. |> Siemens Nixdorf, Oldbury,           |Tel:   +44 344 850450
  28. |> Bracknell, Berks, RG12 4FZ          |Fax:   +44 344 850096
  29.  
  30. I had this exact problem using Informix on AIX 2.0.  This symptom would
  31. occur only when I was accessing AIX through a psuedo terminal (telnet or
  32. rlogin).  I tried to get help from Informix and AIX, but each said the other
  33. was crewing up (suprise!).
  34. The problem is caused by timing, as you suspected, in the AIX pseudo-
  35. terminal driver.  If the ESC and the @/A/etc. are received in separate
  36. packets, they will be delivered separately to the application.  The application
  37. is supposed to wait long enough after an ESC for the following character
  38. to determine if it is an escape sequence (there must be a better way).  In
  39. the case of AIX, and possibly other systems, the time between delivery of
  40. the 2 packets is too long.
  41.  
  42. Finally, I solved this by writting a "wrapper" around the Informix application.
  43. The wrapper would read from stdin and "bunch-up" any escape sequences before
  44. delivering them to the application in one "write()".
  45.  
  46. The wrapper:
  47.         opened the "tty" in a mode that allowed all cahracters to pass
  48.         Forked a child which exec()'d the Informix application
  49.         The wrapper tied its stdout to the child's stdin
  50.         The wrapper passed every character to the application
  51.         if the wrapper saw an ESC, it checked for a follow-on character
  52.           with a reasonable timeout
  53.         If none came, the ESC was passed
  54.         If one did come, the ESC and the follow-on were passed together
  55.           in the same buffer.
  56.  
  57. The wrapper can be tweeked to get the best timeout value, optimize character
  58. throughput by reading with NOWAIT, etc.
  59.  
  60. I wish I still had the code to share with you, but this was two jobs ago
  61. and I have lost track of it.
  62.  
  63. Hope this helps.
  64.  
  65.  
  66.  
  67.  
  68. -- 
  69. Jim Swanson
  70. First Boston Corporation
  71. 5WTC - 9th floor
  72. New York, NY 10048
  73. (212)322-1085
  74.