Back to project page droid-aegis.
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.
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; } }