PDA

Click to See Complete Forum and Search --> : XMLSocket - valid port number?



tompatros
06-26-2001, 09:55 AM
I'm trying to establish and XMLSocket connection to my own computer (running PWS), but a simple connection check returns false every time I try to connect...

< BEGIN CODE >
function myOnConnect(success) {
if (success) {
trace ("connection made.")
} else {
trace ("connection not made. bummer.")
}
}
socket = new XMLSocket()
socket.onConnect = myOnConnect
if (!socket.connect("CSHASHLEYCJ", 8001)) {
trace ("Connection failed!")
}
< END CODE >

CSHASHLEYCJ is the name of my computer. Every time this runs, I get "connection not made. bummer." printed out. Is there a appropriate port number I should be using, or ar there other things I need to configure on the machine to get a connection?

VAYKENT
06-26-2001, 03:49 PM
You might fall under security restrictions for the XMLSocket standard... Your port # is fine - it just has to be above 1024. If I were you, I'd use the IP address of the computer, not the name. I know it's picky, but that's me...

I'd also try placing the HTML page, and the SWF on the 'server' computer and calling the HTML that way. That might eliminate any security problems.

beelineuk
06-26-2001, 04:31 PM
Hi there,

This is something I was playing around with recently. You can't create a loopback XMLSocket connection on the same PC, unless there is an application (acting as a server) that is bindng to that port.

Once you have this you can use the loopback IP 127.0.0.1 to create a loopback XML socket connection with an application on the same pc.

Good luck.

Mike

beelineuk
06-26-2001, 06:11 PM
Sorry just realised you're running PWS.

As long as you have a port to connect to it should be ok. Try using 127.0.0.1 instead of your pc name. Also make sure you leave off the http:// when referencing by IP.

VAYKENT
06-26-2001, 06:29 PM
PWS = Personal Web Server - right??? Or are you guys talking about something different...

If that is the case - PWS doesn't handle XMLSocket.

You need to have an XMLSocket server running to use the XMLSocket functions in Flash. I ass-u-me-ed that you had that running already... ;)

Emphatic
06-27-2001, 05:16 AM
You need a socket server running

Check out http://www.flashnexus.com

Steve