IT Community - Software Programming, Web Development and Technical Support

XML Socket Servers programming in Flash

This is a discussion on XML Socket Servers programming in Flash within the Flash Actionscript Programming forums, part of the Web Development category; An XML socket server is a piece of software that resides on the server and 'listens' on a 'port' for ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Flash Actionscript Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 04-05-2007, 03:00 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up XML Socket Servers programming in Flash

An XML socket server is a piece of software that resides on the server and 'listens' on a 'port' for XML information from a client. When it receives information from a client it looks at the XML tags, and then performs some sort of action, such as broadcasting the information to other clients. XML socket servers can do many different tasks, some of them work with databases, others simply 'echo' information. An XML socket server can be written in Java, Python, C++ etc, and incorporate any number of features.

FLASH XMLSocket Object

The XMLSocket class implements client sockets that let the computer running Flash Player communicate with a server computer identified by an IP address or domain name. The XMLSocket class is useful for client-server applications that require low latency, such as real-time chat systems. A traditional HTTP-based chat solution frequently polls the server and downloads new messages using an HTTP request. In contrast, an XMLSocket chat solution maintains an open connection to the server, which lets the server immediately send incoming messages without a request from the client. To use the XMLSocket class, the server computer must run a daemon that understands the protocol used by the XMLSocket class.

The protocol is described in the following list:

XML messages are sent over a full-duplex TCP/IP stream socket connection.
Each XML message is a complete XML document, terminated by a zero (0) byte.
An unlimited number of XML messages can be sent and received over a single XMLSocket connection.
The following restrictions apply to how and where an XMLSocket object can connect to the server:

The XMLSocket.connect() method can connect only to TCP port numbers greater than or equal to 1024. One consequence of this restriction is that the server daemons that communicate with the XMLSocket object must also be assigned to port numbers greater than or equal to 1024. Port numbers below 1024 are often used by system services such as FTP, Telnet, and HTTP, so XMLSocket objects are barred from these ports for security reasons. The port number restriction limits the possibility that these resources will be inappropriately accessed and abused.

The XMLSocket.connect() method can connect only to computers in the same domain where the SWF file resides. This restriction does not apply to SWF files running off a local disk. (This restriction is identical to the security rules for loadVariables(), XML.sendAndLoad(), and XML.load().) To connect to a server daemon running in a domain other than the one where the SWF resides, you can create a security policy file on the server that allows access from specific domains.

Setting up a server to communicate with the XMLSocket object can be challenging. If your application does not require real-time interactivity, use the loadVariables() function, or Flash HTTP-based XML server connectivity (XML.load(), XML.sendAndLoad(), XML.send()), instead of the XMLSocket class. To use the methods of the XMLSocket class, you must first use the constructor, new XMLSocket, to create an XMLSocket object.

It will be available in ActionScript 1.0; Flash Player 5 and higher version

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
socket programming amansundar VB.NET Programming 15 07-20-2008 02:23 AM
How can I get the DNS servers of a domain name? itbarota PHP Programming 1 09-11-2007 11:59 PM
Socket programming in windows mobile 5.0 its support CAsyncSocket class? theone Windows Mobile 1 07-25-2007 12:24 AM
What is the difference between Windows programming and database programming? Arun VB.NET Programming 0 07-18-2007 07:58 AM
Socket Programming With PHP Jeyaseelansarc PHP Programming 0 05-16-2007 01:33 AM


All times are GMT -7. The time now is 12:27 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
Stamford Dentist | Euro Millions Lottery | Tech Support Services

SEO by vBSEO 3.0.0