Specify a source address/interface to use when using fsockopen

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • phiberoptick@gmail.com

    Specify a source address/interface to use when using fsockopen

    I am looking for a way to specify which IP or interface to use as the
    source when calling fsockopen on a server with multiple IP's.

    Any help or direction would be much appreciated.

    -Ronan

  • Erwin Moller

    #2
    Re: Specify a source address/interface to use when using fsockopen

    phiberoptick@gm ail.com wrote:
    I am looking for a way to specify which IP or interface to use as the
    source when calling fsockopen on a server with multiple IP's.
    >
    Any help or direction would be much appreciated.
    >
    -Ronan
    Hi Ronan,

    source?
    Don't you mean target?
    You want to open a socket from you current machine (that runs PHP and uses
    the fsockopen()) to some other (possibly the same) machine.

    Did you look at www.php.net and looked up the function? I has a link to
    Appendix O that contains some examples for valid targets.

    It is of course also entirely possible I completely misunderstood your
    question. :-)

    Regards,
    Erwin Moller

    Comment

    • Andy Hassall

      #3
      Re: Specify a source address/interface to use when using fsockopen

      On 24 Nov 2006 01:47:51 -0800, "phiberoptick@g mail.com"
      <phiberoptick@g mail.comwrote:
      >I am looking for a way to specify which IP or interface to use as the
      >source when calling fsockopen on a server with multiple IP's.
      >
      >Any help or direction would be much appreciated.
      I'm not sure you can with fsockopen; you have to go down a level to the
      sockets functions: http://uk2.php.net/manual/en/function.socket-bind.php

      --
      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

      Comment

      Working...