diff --git a/.gitignore b/.gitignore
index 94fc867..4882d31 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,7 @@ project.xcworkspace
# Android/IJ
#
+*.iml
.idea
.gradle
local.properties
diff --git a/android/android.iml b/android/android.iml
deleted file mode 100644
index f87ef38..0000000
--- a/android/android.iml
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- generateDebugAndroidTestSources
- generateDebugSources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/android/build.gradle b/android/build.gradle
index f56608f..e59e7e6 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -40,4 +40,5 @@ repositories {
dependencies {
compile 'com.facebook.react:react-native:0.17.+'
+ compile 'com.koushikdutta.async:androidasync:2.1.6'
}
diff --git a/android/src/main/java/com/peel/react/TcpSocketClient.java b/android/src/main/java/com/peel/react/TcpSocketClient.java
deleted file mode 100644
index 223d737..0000000
--- a/android/src/main/java/com/peel/react/TcpSocketClient.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.peel.react;
-
-/**
- * Created by aprock on 12/23/15.
- */
-public class TcpSocketClient {
-}
diff --git a/android/src/main/java/com/peel/react/TcpSocketListener.java b/android/src/main/java/com/peel/react/TcpSocketListener.java
new file mode 100644
index 0000000..9986fb5
--- /dev/null
+++ b/android/src/main/java/com/peel/react/TcpSocketListener.java
@@ -0,0 +1,17 @@
+package com.peel.react;
+
+import java.net.InetSocketAddress;
+
+/**
+ * Created by aprock on 12/28/15.
+ */
+public interface TcpSocketListener {
+ // server
+ void onConnection(Integer serverId, Integer clientId, InetSocketAddress socketAddress);
+
+ // client and server
+ void onConnect(Integer id, InetSocketAddress socketAddress);
+ void onData(Integer id, byte[] data);
+ void onClose(Integer id, String error);
+ void onError(Integer id, String error);
+}
diff --git a/android/src/main/java/com/peel/react/TcpSocketManager.java b/android/src/main/java/com/peel/react/TcpSocketManager.java
new file mode 100644
index 0000000..378485b
--- /dev/null
+++ b/android/src/main/java/com/peel/react/TcpSocketManager.java
@@ -0,0 +1,180 @@
+package com.peel.react;
+
+import android.support.annotation.Nullable;
+import android.util.SparseArray;
+
+import com.koushikdutta.async.AsyncServer;
+import com.koushikdutta.async.AsyncServerSocket;
+import com.koushikdutta.async.AsyncSocket;
+import com.koushikdutta.async.ByteBufferList;
+import com.koushikdutta.async.DataEmitter;
+import com.koushikdutta.async.callback.CompletedCallback;
+import com.koushikdutta.async.callback.ConnectCallback;
+import com.koushikdutta.async.callback.DataCallback;
+import com.koushikdutta.async.callback.ListenCallback;
+
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
+
+/**
+ * Created by aprock on 12/29/15.
+ */
+public class TcpSocketManager {
+ private SparseArray