Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. StreamReader.ReadLine() Problem

StreamReader.ReadLine() Problem

Scheduled Pinned Locked Moved C#
helpcsharpbeta-testingquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    byang
    wrote on last edited by
    #1

    i have been able to send AT commands to my gsm modem and got their response using streams.. im accessing serial communication port to connect to my gsm modem.. my problem now is when i issue the AT+CMGS="" command my app hangs and the modem does not respond the '>' character.. it is as if it does not end reading the stream(???).. i dont know what's the problem with this one. i run it before in .NET 2003 and it works fine. when i upgraded to .NET 2005 beta, thats the time when i started encountering this problem.. added to that.. i think the problem also is with the response of AT+CMGS="" command. it seems that the streamreader.readline() did not encounter an end of line or maybe an end of file(??? not sure) because i tried issuing the command in the hyperterminal and the modem's response is '>' and it waits for user input, which in this case is the message... can anybody help me with this? thank u so much!

    S 1 Reply Last reply
    0
    • B byang

      i have been able to send AT commands to my gsm modem and got their response using streams.. im accessing serial communication port to connect to my gsm modem.. my problem now is when i issue the AT+CMGS="" command my app hangs and the modem does not respond the '>' character.. it is as if it does not end reading the stream(???).. i dont know what's the problem with this one. i run it before in .NET 2003 and it works fine. when i upgraded to .NET 2005 beta, thats the time when i started encountering this problem.. added to that.. i think the problem also is with the response of AT+CMGS="" command. it seems that the streamreader.readline() did not encounter an end of line or maybe an end of file(??? not sure) because i tried issuing the command in the hyperterminal and the modem's response is '>' and it waits for user input, which in this case is the message... can anybody help me with this? thank u so much!

      S Offline
      S Offline
      Steven Behnke
      wrote on last edited by
      #2

      I've had a similar problem where StreamReader.ReadLine() gobbled up one too many line endings while waiting for input over a NetworkStream. I ended up writing my own ReadLine() function to solve this problem.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups