Php script farklı ip adreslere binded başlatmak nasıl?

1 Cevap php

Ben binded 3 ip Adreslerle FreeBSD 7.1 üzerinde ethernet arayüzü var.

# Ifconfig

em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
ether 00:e0:81:b1:1b:4b
inet 89.xx.xx.1 netmask 0xfffffc00 broadcast 89.xx.xx.255
inet 89.xx.xx.2 netmask 0xffffffff broadcast 89.xx.xx.2
inet 89.xx.xx.3 netmask 0xffffffff broadcast 89.xx.xx.3
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active

Php script farklı ip adreslere binded başlatmak nasıl? Ben farklı ip adreslerinden bir hizmete erişmek için bu komut dosyası gerekir.

1 Cevap

Eğer belirli bir IP adresine bir hizmeti kurmak istiyorsanız, sadece socket_bind fonksiyonunun ikinci parametresi olarak bu adrese girin. IP adresi duruma göre değişen ise, bu adresi belirtmek için bir komut satırı parametresini kullanabilirsiniz

If you want the script to use a specified IP address when connecting to a remote service, that is not easy. Since the internet stack on your computer determines which IP address will be used, depending on which network the destination is. And in your case all IP addresses are on the same network.
I think that you you should think in this situation whether it is really required to use a particular address...