Socket binding

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Linux Jay

    Socket binding

    Right, I have a box with multiple IP addresses assigned to it.

    What I want is to be able to connect to elsewhere, appearing as each of those
    IPs. I currently have code where no source IP is set as the extra addresses
    are a new thing to me.

    It looks like it's possible using socket_bind() but that's a bit too low level
    for me, and makes use of an experimental extension module.

    Ideally I would like to be able to bind fsockopen() to a particular IP, then
    repeat and bind it to another IP - is this possible at all? I already have the
    code which deals with fgets() and fwrite(), so it would be much easier as I'm
    not sure how to implement them using the other socket extension.

    Hope that makes sense :) This is my first post here.

    TIA

    --
    J
    My Realm: http://www.myrealm.co.uk/
    'Drink up. The worlds about to end.'
  • Janwillem Borleffs

    #2
    Re: Socket binding

    Linux Jay wrote:[color=blue]
    > It looks like it's possible using socket_bind() but that's a bit too
    > low level for me, and makes use of an experimental extension module.
    >[/color]

    Still, socket_bind() is your friend. And AFAIK, the extension isn't
    experimental anymore (see http://www.php.net/sockets).

    The degree of low-level is not too bad, as you will see with the example on
    the man page (http://www.php.net/socket_bind)


    JW


    Comment

    Working...