LocalServerSocket

Talking to C socket with Scapy

﹥>﹥吖頭↗ 提交于 2020-02-02 04:08:12
问题 I have a UDP connection up and listening on a port (localhost) and I am trying to send a Scapy packet from localhost as well. For some reason, my C code never actually captures the packet, however I can see the packet show up in Wireshark just fine. It's been awhile since I've used sockets, but is there some special socket options I have to set or why would I be able to see the packet in Wireshark just fine but not by the C socket? Note: I was able to successfully catch a packet when I wrote

Android local video server

你说的曾经没有我的故事 提交于 2019-12-18 09:36:26
问题 I am trying to make a local web server using socket that will stream a video. Following is my code for server: class VideoStreamServer { public void startServer() { outFile = new File(outFilePath); Runnable videoStreamTask = new Runnable() { @Override public void run() { try { ServerSocket socket = new ServerSocket(port); StringBuilder sb = new StringBuilder(); sb.append( "HTTP/1.1 200 OK\r\n"); sb.append( "Content-Type: audio/mpeg\r\n"); sb.append( "Connection: close\r\n" ); sb.append(

Talking to C socket with Scapy

萝らか妹 提交于 2019-12-05 15:22:43
I have a UDP connection up and listening on a port (localhost) and I am trying to send a Scapy packet from localhost as well. For some reason, my C code never actually captures the packet, however I can see the packet show up in Wireshark just fine. It's been awhile since I've used sockets, but is there some special socket options I have to set or why would I be able to see the packet in Wireshark just fine but not by the C socket? Note: I was able to successfully catch a packet when I wrote corresponding socket code to send out packets (from localhost) however I am still unable to get the

Android 进程通信套接字LocalSocket

南楼画角 提交于 2019-12-03 10:10:36
我们知道,Android上常见的多进程通讯有以下几种: AIDL 进程通信接口 Binder接口 Messenger通信框架 BroadCastReciever 广播 ContentObserver/ContentProvider FileObserver(http://blog.csdn.net/happy_6678/article/details/7095012) 网络,(http网络中转,rpc,dwr,jms,xmpp) Intent通信 当然,我们还有另一种方案 LocalSocket 是Unix进程通信的基础 认识几个常用的函数: 客户端: LocalSocket客户端使用,创建套接字 LocalSocketAddress 套接字地址,其实就是文件描述符(主要是服务器的地址,当然也可以客户端自个绑定地址) setSoTimeout设置超时 connect客户端主动向服务端请求连接 服务端: LocalServerSocket服务端使用,创建套接字同时指定文件描述符 accept等待客户端连接(阻塞) 共同: getInputStream获取套接字输入流 getOutputStream获取套接字输出流 close关闭套接字,客户服务都需要 关于套接字的通信直接就是对java输入输出流的操作了,但是有一点很重要:对于套接字获取的各种输入或者输出流