Ye Olde Blah

ShiningSource.org => General Programming Forum => Topic started by: Job on September 22, 2004, 03:21:53 pm



Title: Socket Problems
Post by: Job on September 22, 2004, 03:21:53 pm
I've been hard at work lately trying to make use of Flash's XMLSocket object. It needs an XML Socket server running at the server that listens in at a specific port. So i created a very simple socket server, using .NET, that echoes back any information sent by flash.
In my machine at home this works perfectly (though i have to disable my firewall). At brinkster flash can't connect to the desired port, though the socket server works fine (a server working inside a server, imagine that :P). The problem i imagine is that their firewall prevents flash from connecting to a port.
So i've bothered the support people at brinkster with this and asked them if there's a work around, but they didn't know anything about it.
I've tried different socket servers, mine in ASP.NET, and another in PHP.
If i were able to get a host that allows me to do what i want, i could build multiplayer flash games. I could host the game in my IIS server, but my machine is so terribly slow, it wouldn't be a good idea.
Ty, does your host allow you to connect to ports on their servers? I know when you were building SO you wanted to implement some online functionality, how were you going to tackle this?

All info welcome.


Title: Socket Problems
Post by: Ty on September 22, 2004, 03:32:18 pm
Hey Job,

I was going to use a cleint - client model for SO, with the server just hosting information about what games were going on. This would have used a PHP script to register each session with the database. This would ease the load on the server, at a cost of cheating between players. Not sure how it would have worked outside of the theory, but sounded good at the time. I'd probably stick with the same model now, but replacing the basic php script with a web service.

I don't think many hosts will allow connections on different ports, it's something of a security risk as far as they're concerned. You're more than welcome to try here if you want, but I would doubt it would work.


Title: Socket Problems
Post by: Job on September 22, 2004, 03:53:58 pm
Ah, client-client. That never occured to me. What would you do if the a client is running a firewall that prevents this?


Title: Socket Problems
Post by: Ty on September 22, 2004, 04:02:10 pm
Most firewalls have an option to check if a program should be allowed to access the 'net, so that's what I was basing it on. I'm not sure how Flash would handle it, so it's worth testing.


Title: Socket Problems
Post by: Job on September 22, 2004, 04:16:18 pm
Flash can't do it by itself. It needs a socket server listening in on the port it wants to connects to.
I could do it using the standalone flash player i think, by calling my socket server script (it's written using VB script) at run time.
I much prefer to do it from the browser though. So i'm thinking, let the server keep track of users and sessions and the like. Whenever a user wants to join a multiplayer game, the server updates its database and sends a page to the client that contains client-side VBScript which composes the socket server, and the flash movie. Thus having a socket server running and the flash movie ready, every user will be ready to connect to, and receive connections from other clients.
I'm not sure VBScript running on the client from a web page can create a socket server though. There must be some restricted functionality by IE's security settings for example.


Title: Socket Problems
Post by: Ty on September 22, 2004, 04:21:22 pm
I think IE would restrict the VBscript, but I'm sure there's a way around it. You could always use Java ;) Malicous socket servers could do plenty, so I'm pretty sure they're blocked.

What you said is sound, but I have no idea about Flash so I can't be of much help there I'm afraid.


Title: Socket Problems
Post by: Job on September 22, 2004, 04:27:20 pm
Maybe i just need a host that runs an XMLSocket for flash. I've seen some around, but i already prepaid Brinkster one year in advance.  :(
I'll look into it...


Title: Good times
Post by: Anonymous on November 09, 2005, 02:23:12 am
Quote
Maybe i just need a host that runs an XMLSocket for flash. I've seen some around, but i already prepaid Brinkster one year in advance.

 Sure sounds like good times! Great job man, I wish I could do exactly that right now...


Title: wrong
Post by: Anonymous on November 11, 2005, 09:51:09 am
Do you not think you were wrong?:X:X