Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    the Netherlands
    Posts
    215
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Big challange (two scripts "talking")

    I'm trying something really difficult (I guess).

    What I want to do:
    I'm creating two scripts; reciever.cgi and caller.cgi the reciever.cgi will be running on my server, lets say 127.0.0.1 on port 1234.
    Now, when I run caller.cgi I want this one to connect to reciever.cgi, tell the local version, ask what the newest version is and close the connection.

    What I got:
    Reciever.cgi is working pretty well, if I connect to it using SecureCRT (a Telnet and others program) it all works fine:
    (* (red)=reciever.cgi and - (green)=Me (SecureCRT)
    * Hello 127.0.0.1:1579
    - version: 1.2.3.4
    * you are running version 1.2.3.4
    - version?
    * version=2.0
    - quit
    * Bye

    and the output in the Commandprompt (WinXP) in wich reciever.cgi is running tells me this:
    listening at port 1234
    127.0.0.1:1588 connected
    Current user(s) online: 1
    version 1,234 (1.2.3.4) found on 127.0.0.1:1588
    127.0.0.1:1588 disconnected
    Current user(s) online: 0


    The problem:
    Everything seems to work fine, but caller.cgi hasn't been used
    As soon as this script comes into play it all goes wrong:
    Output of caller.cgi:
    Hello 127.0.0.1:1589
    you are running version 1.2.3.4
    version?


    Output of reciever.cgi using caller.cgi:
    127.0.0.1:1589 connected
    Current user(s) online: 1
    version 1,234
    version?
    qui <1.2.3.4
    version?
    qui> found on 127.0.0.1:1589


    Conclusion:
    It looks like reciever.cgi doesn't know when caller.cgi ends a line (where it does using SecureCRT)

    Question:
    Is there anyone who can fix this problem and make these scripts work? Or at least give me a hint?

    I hope I didn't frighten you with all this text.

    Thank you so much!
    Mzzl, Chris


    P.S. I got a zip-file attached (talking.zip) with the two files
    Attached Files Attached Files

  • #2
    New Coder
    Join Date
    Aug 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is not an easy one to work on considering the circumstances...

    Personally, I think you've got latency issues between your calling and receiver script... that is, your calling script is blabbing out all of those commands before the receiver script can even get a word out edgewise.

    This should always work on paper, but you're dealing with io ports and backside server resources that must be configured by the program when it gets triggered. Consider that also... your calling script is working 3 times faster than the receiver... (check your script length), and it might make some sense.

    I ran these between two separate servers and came up with the same problem, but I did have different results from you.... which means that it is a time delay that you've got to work around.

    There's a lot of info out there on the IO mods, but I've never found anything other than "my father the sw engineer wrote this at harvard", and virtually nothing that actually makes any sense - to the normal set of us fools to properly use all of the parameters of these things. Maybe somebody else has dealt with this and can help.

    Just my 2 cents.

    PS: I'm working with the same kind of thing myself, but I'm doing openssl/ssleay (successfully though...) and this is NOT a very kind hearted area to work in for the gp programmer; You almost need to become a specialist in it, keep good notes, and never lose them because there will always be a need for it in the future.

    That said, don't you hate all of the web references that show up on the search engines that seem to have everything you need in the description... and yet, the web freakin page is disappeared or dead cause some .edu/~student/watchme/~myperfectscript-to-solve-your-exact-problem.html guy left campus and went to work for microsoft?

    lol!
    Last edited by pager; 08-15-2002 at 03:13 AM.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    the Netherlands
    Posts
    215
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Though your reply didn't solve my problem I want to thank you for replaying and taking time to look at my script.

    This doesn't mean I don't want this problem solved, so if there's anyone who can give me more information on this...

    Mzzl, Chris

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Brisbane, Australia
    Posts
    181
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I have an idea ...

    you can make an image that goes on the persons page which is located on your server

    then when they enter an administration script or something ... it gets that image (eg: if the person is using version 1.4.5 then the script gets that image and returns it on the clients page.

    eg: <img src=http://myhost.com/v1.4.5.gif>

    then when a new version comes out ... you can change the text on that image to say "this version is now old" and the current version can say "this is the latest version ... no reason to update"

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    the Netherlands
    Posts
    215
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is really great and solves a part of the problem.

    But this isn't the only reason I want these scripts to talk.
    I know it's possible I've seen it on http://www.slyfx.com @ level 8 b
    @ SlyFX the have challenges for the visitors, one of them was this:
    Time for something a bit different now. You will need to setup a server on your computer on port 7654 for this (here was a link, but I can't give it to you because of the rules of SlyFX) script to connect to.
    Pass the script the IP to connect to using a GET request for example sock.pl?ip=0.0.0.0
    The script has a simple protocol, just follow it as described below:

    Script handshake:
    [script sends] Hello
    [script sends] END
    [ you reply ] Hello Back
    [ you reply ] END
    [script sends] [100 random numbers]
    [script sends] END
    [ you reply ] [you reply with "lowestnumber:highestnumber" (without the quotes)]
    [ you reply ] END
    If the result is correct, the script will reply with the solution.

    On that one I passed, but I only had to do one part (the reciever.cgi wich accepts the call) their script connected to mine

    So if anyone knows how to do this, I'm very interested

    Mzzl, Chris


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •