473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

Nov 24 '06 #1
2 5605
ph**********@gmail.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
Nov 24 '06 #2
On 24 Nov 2006 01:47:51 -0800, "ph**********@gmail.com"
<ph**********@gmail.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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: YAN | last post by:
Hi, I want to get the mac address from a machine, which i have the IP address of that machine, how can i do that? I know how to get the mac address of the local machine from the following code: ...
1
by: meulie | last post by:
Hi all! Is it possible to bind MySQL 4.1 to more than 1 interface? Will multiple 'bind-address=x.x.x.x' statements do the job? Regards, Evert
9
by: fipaj1992 | last post by:
Hi! I have very big problem with fsockopen() function. It is very important... That's code: <?php $test = fsockopen ('chrome.pl', '8080'); ?>
3
by: Morten | last post by:
Hi! I'm trying to manage public folders using C#. I have found some code that allows me to mail enable a folder: foreach( System.Management.ManagementObject instmailbox in queryCollection ) {...
0
by: comp.lang.php | last post by:
I wrote a method that should check if an email address is valid. In another method I've already checked to see if $_POST exists and is well-formed, so those checks are not necessary in this scope....
1
by: Syl | last post by:
Hi group - I have a database table with 4 columns that hold a url. I am selecting each url and I need to check to see if it is valid. I assumed I could use the fsockopen command. I've had to...
3
by: Maksim Kasimov | last post by:
Hi, how to set source ip-address when do __socket.connect((host, port)) on a machine that have a several ip-adresses? many thanks for advice. __socket = socket.socket(socket.AF_INET,...
9
by: xhe | last post by:
Hi, I need to program to check the validity of IP address through PHP Initially I used this one: $url="http://www.ntc.gov.au/ViewPage.aspx? page=A02400304500100020"; $fp=fopen($url,"r");...
2
by: Mali Findik | last post by:
Hi @ll, i've got problems with sending an UDP broadcast datagramm over two network interfaces. The code is like this: <Code> UdpClient client = new UdpClient(); IPEndPoint remoteEndPoint =...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.