socket_bind() Error

0 views
Skip to first unread message

ashore

unread,
Jul 2, 2009, 9:21:47 AM7/2/09
to Professional PHP Developers
Folks, I'm getting subject error trying to get the handshaking started
between a client and a server script, both trivial for learning
purposes. Both client and server are on the same host; win32 under
apache.

Specific complaint is
"socket_bind() [function.socket-bind]: unable to bind address [0]:
Only one usage of each socket address
(protocol/network address/port) is normally permitted"

So given that, how does one connect a client and server on a given
host? Thanks for any help.

C. (http://symcbean.blogspot.com/)

unread,
Jul 2, 2009, 9:49:40 AM7/2/09
to Professional PHP Developers
Are you really trying to bind to port 0???? If so I would have thought
the reason it was failing would be self evident.

C.

A. Shore

unread,
Jul 2, 2009, 3:02:21 PM7/2/09
to Professional PHP Developers
Nope, used a valid port no. My guess is that address [0] doesn't
refer to the port no but rather a complete address. But I'm a noob on
this stuff, so ... .

AS

On Jul 2, 8:49 am, "C. (http://symcbean.blogspot.com/)"

C. (http://symcbean.blogspot.com/)

unread,
Jul 3, 2009, 7:39:41 AM7/3/09
to Professional PHP Developers
So which end is reporting the error? Server or client? If at the
client, are you trying to specify a port number in the socket_bind
call? (should be left blank - you tell it what the remote port number
is in socket_connect())

C.

PatiDure

unread,
Jul 3, 2009, 4:09:15 AM7/3/09
to Professional PHP Developers
Are You trying to bind both client and server to same IP:PORT ?
You can bind only one connection to ip/port pair and error You get
explains that You try to bind to a combination which is already
binded...

Bind only the server to that.


--
Henri Hovi
http://www.patidure.com
Reply all
Reply to author
Forward
0 new messages