# how can I make a connection from as2 to c++ with xml sockets?

**URL:** https://forum.kirupa.com/t/how-can-i-make-a-connection-from-as2-to-c-with-xml-sockets/635891
**Category:** flash
**Created:** [February 3, 2017, 3:01am UTC](https://forum.kirupa.com/t/how-can-i-make-a-connection-from-as2-to-c-with-xml-sockets/635891 "2017-02-03T03:01:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Serifaz](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@Serifaz](https://forum.kirupa.com/u/Serifaz)
#### Post date: [February 3, 2017, 3:01am UTC](https://forum.kirupa.com/t/how-can-i-make-a-connection-from-as2-to-c-with-xml-sockets/635891/1 "2017-02-03T03:01:50Z")

</div>

I don’t know how many here are familiar with c++ or making it communicate with flash but I know as2 must use xml sockets to communicate with a c++ server. I have made a simple c++ console app that I want to gather data from.  
Specifically I want to make a log in system where users can log in with a username and password.  
The reason I am using as2 is the client I am making this on uses a version of scaleform that only supports as2.  
In a sum up I want my flash application to send data to xml, xml to send that data to c++ if the credentials match it sends the user to another frame.

Currently I am only able to grab data from values directly typed into the c++ console application.  
If the info is correct it sends back an ok to the consul if not it sends an error.

I have no current code for sending and receiving data from flash to xml /c++ and back.

that is why I am here I can’t find any documentation anywhere that tells you how to do it.  
if you have a link to that I would love to have it. otherwise can you please tell me how I can achieve this or put some sample code in a reply 🙂

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [February 3, 2017, 6:24am UTC](https://forum.kirupa.com/t/how-can-i-make-a-connection-from-as2-to-c-with-xml-sockets/635891/2 "2017-02-03T06:24:32Z")

</div>

This goes beyond my level of understanding…of everything! ☹

---

<div class="post-metadata">

### Author: ![Serifaz](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@Serifaz](https://forum.kirupa.com/u/Serifaz)
#### Post date: [February 3, 2017, 10:32am UTC](https://forum.kirupa.com/t/how-can-i-make-a-connection-from-as2-to-c-with-xml-sockets/635891/3 "2017-02-03T10:32:17Z")

</div>

I feel ya…  
been trying to figure this out for weeks. no info I can find anywhere

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [February 3, 2017, 12:14pm UTC](https://forum.kirupa.com/t/how-can-i-make-a-connection-from-as2-to-c-with-xml-sockets/635891/4 "2017-02-03T12:14:29Z")

</div>

I dont think I’ve ever seen one out there in c++ (edit: thats a lie), but there are a number of tutorials out there for socket servers in other languages. Here’s one I quickly dug up for Java: [http://www.giantflyingsaucer.com/blog/?p=205](http://www.giantflyingsaucer.com/blog/?p=205)

I don’t know how different AS2 is from AS3, but I imagine all the changes that were made for security with sockets transcended both languages. The big one is being able to handle the initial handshake with the policy file. … scanning through the tutorial linked above, I’m not seeing any mention of that. I think we had something on [adobe.com](http://adobe.com) that covered this. Maybe I can find that one… yeah here’s the one I was thinking of: [http://www.adobe.com/devnet/flashplayer/articles/socket\_policy\_files.html](http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html) Of course that is very policy-fil- centric vs more about making a server. Anyway, hopefully this can help get you going.

---

<div class="post-metadata">

### Author: ![Serifaz](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@Serifaz](https://forum.kirupa.com/u/Serifaz)
#### Post date: [February 3, 2017, 5:46pm UTC](https://forum.kirupa.com/t/how-can-i-make-a-connection-from-as2-to-c-with-xml-sockets/635891/5 "2017-02-03T17:46:39Z")

</div>

thank you I will check out both links.  
Ill let you guys know if I have any success
