C# Socket Server for Flash/ActionScript

by Cameron Albert 27. July 2007 15:13

After doing some research on available socket servers for Flash I decided to write my own in C#. Most of the server out there are written in Java and while there are some open source implementations I prefer to stick with a code base I know and understand.

I got the Flash movie to connect to the C# server yesterday using JSON protocal instead of XML as my transport mechanism. I used a .NET JSON library and an ActionScript 2.0 JSON library to build the objects on both sides. I created a C# class for passing data, serialize as a JSON string and send it the Flash movie. On the ActionScript side I created an AS class that mimics my C# data gram class and use the AS JSON lib to serialize and send that same object structure to the C# server. Working pretty good so far, I am able to login to the server and send and receive messages.

My next steps will be creating a basic flash game that I can use to run around and do battle while sending and receiving messages from the server. 

I have plans to make a Flash based PBBG with real time combat, we'll see how it goes. :) 

Comments

1/22/2008 2:26:14 PM #

Stu

Let me know how you get on with the socket side of things with SL.  Sounds really interesting!

Stu United Kingdom

12/4/2008 1:37:42 AM #

Busby SEO Test

You said that you have a plans to make a Flash based PBBG with real time combat. When? Smile  

Busby SEO Test United States

8/19/2009 10:51:33 PM #

Lån Penge

Thanks.. Funny, I actually had this on my mind a few days ago..

Lån Penge Denmark

8/19/2009 10:57:29 PM #

calbert

I have actually been in the Silverlight world since shortly after writing this. I do have a multi-player set of components I am writing for Silverlight games that should be complete in the in alpha before too much longer.

calbert United States

Powered by BlogEngine.NET 1.5.0.7
Modified Theme by Mads Kristensen

About the Author

CameronAlbert.com I am Senior Software Development Consultant specializing in Silverlight, WPF and the Microsoft .NET Framework. 

I have released an iPhone game called the Adventures of Puppyman that was built using ExEn and am currently working on a WP7 and iPhone version of Perenthia soon to be released.

View Cameron Albert's profile on LinkedIn
See how we're connected

Follow cameronalbert on Twitter

 

Recommended Books

Silverlight 4 Business Application Development - Beginner's Guide:

http://www.packtpub.com/microsoft-silverlight-4-business-application-development-beginners-guide/book

Microsoft Silverlight 4 Business Application Development: Beginner’s Guide