Edit report at https://bugs.php.net/bug.php?id=50047&edit=1

 ID:                 50047
 Comment by:         drclue at drclue dot net
 Reported by:        naox at o2 dot pl
 Summary:            interface binding for fsockopen (like socket_bind)
 Status:             Open
 Type:               Feature/Change Request
 Package:            Network related
 Operating System:   -
 PHP Version:        5.2.11
 Block user comment: N
 Private report:     N

 New Comment:

I know this is an OLD thread to be bumping , but the missing bind facility in 
fsockopen() is exactly my problem today.

The knee jerk thought that most people have is that one is trying to
bind as a server, BUT in this use case I'm binding the client.

The particular application is an ip hygiene tester for a level 3 networking
company that verifies if particular source IP addresses can send mail, prior 
to leasing them out to corporate clients like Walmart. We do various DNS lookups
to spamhaus servers , and as a final test send test mails to test email accounts
we have established at the target servers of interest to the clients to verify
the /24 ip ranges will indeed deliver mail. (THIS IS NOT A SPAM SYSTEM).  

The server I'm developing on is configured with multiple ip addresses and the 
application needs to bind the client socket to perform the tests.

My existing mail routines use fsocket functions , so I'm having to investigate
various work arounds such as making a stream wrapper just to get that bind 
function in there. I really don't want to recreate all the feof , fread , fgets 
etc. logic.


Previous Comments:
------------------------------------------------------------------------
[2009-11-03 04:40:27] naox at o2 dot pl

nope. this would be setting destination not source interface. Check out 
http://php.net/manual/pl/function.socket-bind.php
this however is for socket functions not "network" like fsockopen

------------------------------------------------------------------------
[2009-11-03 03:06:00] srina...@php.net

is this some thing what you are looking for ?
$fp = fsockopen("tcp://127.0.0.1", 8080);

or 
$fp = fsockopen("unix:///tmp/mysocket", ..);


------------------------------------------------------------------------
[2009-11-01 00:26:59] naox at o2 dot pl

Description:
------------
PHP really needs interface binding for fsockopen() (like socket_bind())



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=50047&edit=1

Reply via email to