Android Open Source - droid-aegis Stream Sock






From Project

Back to project page droid-aegis.

License

The source code is released under:

MIT License

If you think the Android project droid-aegis listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.app.camstreamer;
/*  www.  j  av a 2 s .  c  om*/
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
import java.net.UnknownHostException;

public class StreamSock {
  Socket      mSock;
  
  public StreamSock () {
    mSock = new Socket();
  }

  public boolean connectSock (String host, int port) {
    boolean        connected = false;
    SocketAddress    mAddr = null;
    try {
      mAddr = new InetSocketAddress(InetAddress.getByName(host), port);
    } catch (UnknownHostException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if (mAddr != null) {
      try {
        mSock.connect(mAddr);
        connected = true;
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return connected;
  }
  
  
  public boolean sendData (BufferHandler mFrame) {
    OutputStream    mOut = null;
    try {
      mOut = mSock.getOutputStream();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return false;
  }
}




Java Source Code List

andi.cctv.app.MainActivity.java
andi.cctv.app.MediaController.java
andi.cctv.app.Sockit.java
andi.cctv.app.ToFile.java
andi.cctv.app.WifiCheck.java
com.app.camstreamer.BufferHandler.java
com.app.camstreamer.BufferNotifications.java
com.app.camstreamer.BufferPool.java
com.app.camstreamer.MainActivity.java
com.app.camstreamer.MockCamera.java
com.app.camstreamer.StreamSock.java