View Full Version : XML socket server question
Rob2000
03-31-2004, 11:36 AM
I am creating a multi-user gaming/chat app in Flash using XML sockets. I am relatively new to web development, but I am an expert in TCP/IP socket programming for single board computers and Windows applications.
It would be extremely easy for me to write a socket server application in C or C++ to communicate with my Flash clients. I could probably even reuse code I've done in the past since socket code is very portable.
The part I do not understand is how the socket server applications are run. Do I have to get my site's host to agree to running my application on its server, and to have a port dedicated to my application? This doesn't seem like something they would be too eager to do. How do sites that create their own socket server applications normally do this? Do they usually own their own server as well? Or are there hosts out there that agree to letting you run your own applications on their server? Or am I just way off in my thinking? :D
freddycodes
03-31-2004, 01:51 PM
Yeah that will be tough to implement in a shared hosting env.
I have always run my socket servers on a dedicated server to which I have root access. Because as you know opening ports, and configuring dameons to run, is something you will need root access to do.
Chances are you are going to have a hard time convincing a host to do that for you. But you may be able to.
Rob2000
03-31-2004, 02:32 PM
Thanks, freddycodes. I figured as much. I guess I'll have to set up my own Linux server.
I was also wondering if I'd be able to test out my Flash clients with socket server code running on my local machine. I know that Flash will only allow socket connections to the same sub-domain that the swf file was loaded from. If I run my socket server app on the same machine where I manually opened the swf file, will Flash allow me to open a soccket connection by specifying my own I.P address?
freddycodes
03-31-2004, 03:21 PM
Yes, the limitation comes into play when you are trying to play the swf embedded in an html doc in a browser. Standalone swfs, and testing from within Flash IDE can connect to other sub-domains.
Rob2000
03-31-2004, 08:24 PM
Great! Thanks.
I have one more question. I have read that it's possible to send raw binary data instead of strings from the Flash client. Do you know how I can do that?
freddycodes
04-01-2004, 12:48 AM
What kind of raw binary data are we talking about? Sound or pictures. I am not sure this can be done over regular XMLSocket. Or else Macromedia's Flash Communication Server would have little to no value.
Rob2000
04-01-2004, 10:06 AM
My understanding is that the XML sockets can send any ascii string data, regardless of whether or not it is in XML format. Is it possible to send numerical data as opposed to ascii string data.
For example, if I do an xmlObject.send(0xffff), the data I get on my socket server is a 48 bit ascii string "65535" (0xffff in decimal and a null byte at the end of the string). Is there a way to send the actual 16 bit number 0xffff?
Using numerical constants for message and command headers, etc. would speed up my application. I would be sending less data back and forth, and I would be eliminating the overhead invlolved with string manipulation. I would just have to write my own custom parser as opposed to using an XML parser. That would not be a problem though.
freddycodes
04-01-2004, 12:16 PM
So without further bullsh%tting I am going to say I have no idea. But as far as I know only ascii text can be sent. It doesn't have to be xml as you are aware of. But I am pretty sure binary data cannot be sent.
baskar
03-12-2007, 08:02 AM
hi
i m having a socket server program running in different server and i have launched a swf in different server in that case where should i keep the crossdomain policy file, in the socket server or in the http server.
and how to refer that crossdomain policy file in flash.
regards
baskar
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.