Upon telnetting to C-Gate, the 1st command issued always receives 400 SYNTAX ERROR

Discussion in 'C-Gate Developers' started by greig, Jan 21, 2010.

  1. greig

    greig

    Joined:
    Aug 3, 2004
    Messages:
    72
    Likes Received:
    3
    Location:
    Petersham - Sydney
    Hi All,


    Has anyone else seen this problem or is it just me?

    Scenario: C-Gate 2.7.1 (build 2283) & Toolkit 1.10.9 (build 471) running on a machine running Win7 x86, talking to a CNI on the local network.

    If C-Gate is running and I telnet to port 20023, the first command I send is always rejected with "400 Syntax Error".

    In this screen-scrape from Procomm, I connected, typed NOOP <CR>, then repeated the same command again - with a diffferent result each time.

    201 Service ready: Clipsal C-Gate Version: v2.7.1 (build 2283) #cmd-syntax=1.0
    400 Syntax Error.
    200 OK.


    I've tested this under program control (through PHP) and also manually using Procomm and it's reproducible every time... Obviously with other commands, not just NOOP.

    My work-around is simple enough: just send a CR after you connect and before you go to issue a meaningful command.

    Wondering if it's a bug in C-Gate or just me...?? :rolleyes:


    - Greig.
     
    greig, Jan 21, 2010
    #1
  2. greig

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    770
    Likes Received:
    21
    Location:
    Adelaide
    Hi greig,

    I can't reproduce that I'm afraid.

    C:\Clipsal\C-Gate2>java -jar cgate_2283.jar
    Clipsal C-Gate(TM) v2.7.1 (build 2283)
    Logging to file: event.log

    Telnetting to 20023:

    201 Service ready: Clipsal C-Gate Version: v2.7.1 (build 2283) #cmd-syntax=1.0
    noop
    200 OK.

    Do you still get the syntax error if you manually connect using the native client (ie. "telnet localhost 20023") and then type "noop"?
     
    daniel, Jan 21, 2010
    #2
  3. greig

    greig

    Joined:
    Aug 3, 2004
    Messages:
    72
    Likes Received:
    3
    Location:
    Petersham - Sydney
    Hi Daniel,


    Good thought!

    I had to install the Telnet Client on my Win 7 Pro, but now done it works 100%. I get an OK with the first command issued to the 'Bus.

    I then went and installed TK & CG on another (XP) machine here and it also works 100% from the command line / Telnet.

    I can't fathom know why I'm seeing the strangeness with Procomm and my PHP code - but like I said above, I have a work-around...

    Thanks for the suggestion - seems it is just me! :confused:


    - G.
     
    greig, Jan 22, 2010
    #3
  4. greig

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,398
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Not sure about Procom or PHP...

    Perhaps check to see if they are doing some strange Unicode stuff (possibly even sending things like byte order markers on opening the stream... that would probably be a bad thing).
     
    ashleigh, Jan 22, 2010
    #4
  5. greig

    greig

    Joined:
    Aug 3, 2004
    Messages:
    72
    Likes Received:
    3
    Location:
    Petersham - Sydney
    Thanks Ashleigh - I tried all of that, but the available debugging tools gave me a blank.

    Procomm has a great 'monitor window' that lets you check the hex flowing in each direction, but it revealed nothing. :-(
     
    greig, Jan 24, 2010
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.