# How to transfer data between two servers?

**URL:** <https://community.wowza.com/t/how-to-transfer-data-between-two-servers/36202>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [April 24, 2012, 12:38pm UTC](https://community.wowza.com/t/how-to-transfer-data-between-two-servers/36202 "2012-04-24T12:38:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_1055\_1072\_1096\_1072](https://avatars.discourse-cdn.com/v4/letter/_/848f3c/32.png) [@\_1055\_1072\_1096\_1072](https://community.wowza.com/u/_1055_1072_1096_1072)\
**Post date:** [April 24, 2012, 12:38pm UTC](https://community.wowza.com/t/how-to-transfer-data-between-two-servers/36202/1 "2012-04-24T12:38:51Z")

</div>

We have two servers that need to communicate with each other.

Something like this:

server1

```auto
public int getSomedataBoth() {
     return this.someData + Server2.getSomeData();
}
public int getSomeData() {
     return this.someData;
}

```

server2

```auto
public int getSomedataBoth() {
     return this.someData + Server1.getSomeData();
}
public int getSomeData() {
     return this.someData;
}

```

Therefore, any client will receive the sum of someData regardless of which server it is connected.

How can I implement this communication?

---

<div class="post-metadata">

**Author:** ![Randall\_Auriemma](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@Randall\_Auriemma](https://community.wowza.com/u/Randall_Auriemma)\
**Post date:** [April 24, 2012, 1:20pm UTC](https://community.wowza.com/t/how-to-transfer-data-between-two-servers/36202/2 "2012-04-24T13:20:13Z")

</div>

There is nothing (for the most part) built into Wowza to communicate externally. You would do it the same way you would using any other two Java programs.

You could use:

1. Java sockets

2. HTTP Provider

3. RPC

4. You could have your flash client connect to a stream on each server and use Flash RPC. (but that’s a little weird)

Normally you would use a Shared object to let flash clients communicate with each other, for example for Chat. You could potentially use one of the above external methods two sync the shared objects on each server…

---

<div class="post-metadata">

**Author:** ![\_1055\_1072\_1096\_1072](https://avatars.discourse-cdn.com/v4/letter/_/848f3c/32.png) [@\_1055\_1072\_1096\_1072](https://community.wowza.com/u/_1055_1072_1096_1072)\
**Post date:** [April 24, 2012, 9:11pm UTC](https://community.wowza.com/t/how-to-transfer-data-between-two-servers/36202/3 "2012-04-24T21:11:59Z")

</div>

> You could potentially use one of the above external methods two sync the shared objects on each server…

Yes, that’s exactly what I need. I will try to use sockets, tnx!
