2 Replies Latest reply on Feb 14, 2008 1:21 AM by tware

    Is It Possbible To Monitor Any Given TCP Port In Director!

    tware
      Hi

      Using Director MX 2004 under WinXP Pro.

      Does anyone know if it's possible to use WaitForNetConnection to monitor any given TCP port where the incoming data could be anything, but most certainly isn't from another Director application, but might be from say a mail server, telnet, an FTP server responding on the specified port, or whatever...!

      I've not had a lot of success using WaitForNetConnection to do this... (Code below).

      If WaitForNetConnection cannot be used to monitor a TCP port, does anyone know if there are any xtras commercial or otherwise that will do this?

      Many Thanks
      TW.

      Code:

      gMuiR.setNetMessageHandler(#xFTPHandlerIn, script "CallBacksIn")
      gMuiR.setNetBufferLimits( 128 * 1024, 512 * 1024, 250 )

      [...]

      on FTPWaitForConnection n, p
      -- n = IpAddress of FTP Server in "x.x.x.x" format, p = integer, port no
      global gMuiR, svIPAdr
      if gMuiR.WaitForNetConnection( svIPAdr, p, 4) = 0 then
      put "Waiting For Net Connection On Port : " & p
      r = 0
      else
      put "Error On Wait For Net Connection."
      r = 1
      end if
      return r
      end

      When I connect to the specified port using telnet or whatever, the callback handler returns error -2147216214 (the hugely informative "connection problem"...).

        • 1. Re: Is It Possbible To Monitor Any Given TCP Port In Director!
          Level 7
          If by 'monitor' you mean launch a host that will accept tcp connections,
          then:
          The multiuser xtra supports text mode, but does not support binary transfers
          when in text mode (null character terminated strings).
          With smtp you should be ok, due to the encoding of the mail content.
          For ftp, it just won't work, since binary data are exchanged.

          > If WaitForNetConnection cannot be used to monitor a TCP port, does anyone
          > know
          > if there are any xtras commercial or otherwise that will do this?
          If you mean an Xtra that can accept tcp connections and allow you to process
          the data received, contact me off-list at info at rtr gr..

          "tware" <webforumsuser@macromedia.com> wrote in message
          news:fova33$ck1$1@forums.macromedia.com...
          > Hi
          >
          > Using Director MX 2004 under WinXP Pro.
          >
          > Does anyone know if it's possible to use WaitForNetConnection to monitor
          > any
          > given TCP port where the incoming data could be anything, but most
          > certainly
          > isn't from another Director application, but might be from say a mail
          > server,
          > telnet, an FTP server responding on the specified port, or whatever...!
          >
          > I've not had a lot of success using WaitForNetConnection to do this...
          > (Code
          > below).
          >
          > If WaitForNetConnection cannot be used to monitor a TCP port, does anyone
          > know
          > if there are any xtras commercial or otherwise that will do this?
          >
          > Many Thanks
          > TW.
          >
          > Code:
          >
          > gMuiR.setNetMessageHandler(#xFTPHandlerIn, script "CallBacksIn")
          > gMuiR.setNetBufferLimits( 128 * 1024, 512 * 1024, 250 )
          >
          > [...]
          >
          > on FTPWaitForConnection n, p
          > -- n = IpAddress of FTP Server in "x.x.x.x" format, p = integer, port no
          > global gMuiR, svIPAdr
          > if gMuiR.WaitForNetConnection( svIPAdr, p, 4) = 0 then
          > put "Waiting For Net Connection On Port : " & p
          > r = 0
          > else
          > put "Error On Wait For Net Connection."
          > r = 1
          > end if
          > return r
          > end
          >
          > When I connect to the specified port using telnet or whatever, the
          > callback
          > handler returns error -2147216214 (the hugely informative "connection
          > problem"...).
          >
          >
          >




          • 2. Re: Is It Possbible To Monitor Any Given TCP Port In Director!
            tware Level 1
            alchemist wrote:

            >If by 'monitor' you mean launch a host that will accept tcp connections,
            >then:

            I'm glad you know what I meant to mean!

            >The multiuser xtra supports text mode, but does not support binary transfers
            >when in text mode (null character terminated strings).
            >With smtp you should be ok, due to the encoding of the mail content.
            >For ftp, it just won't work, since binary data are exchanged.

            Yes, but I would have thought I could handle the text based control channel stuff...

            >If you mean an Xtra that can accept tcp connections and allow you to process
            >the data received, contact me off-list at info at rtr gr..

            Be there in a minute! Thanks.