473,441 Members | 1,904 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,441 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 5611
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 =...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
1
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.