ipc

How can a remote Service send messages to a bound Activity?

房东的猫 提交于 2020-01-31 08:54:01
问题 I've read the documentation about Bound Services, where it is shown that you can easily communicate through Messages from an Activity to a remote (i.e. not in the same context) Service but is there any way to send messages from the Service to the bound Activity ? For example, my activity bounds to a running background service of the same application, sends a message to it and upon the reception of this message the service replies with a message to the activity.. how do I implement this? Can

How can a remote Service send messages to a bound Activity?

痴心易碎 提交于 2020-01-31 08:51:06
问题 I've read the documentation about Bound Services, where it is shown that you can easily communicate through Messages from an Activity to a remote (i.e. not in the same context) Service but is there any way to send messages from the Service to the bound Activity ? For example, my activity bounds to a running background service of the same application, sends a message to it and upon the reception of this message the service replies with a message to the activity.. how do I implement this? Can

IPC$局域网入侵详解

烂漫一生 提交于 2020-01-27 01:28:36
什么是ipc$   IPC$(Internet Process Connection)是共享" 命名管道 "的资源(大家都是这么说的),它是为了让进程间通信而开放的命名管道,可以通过验证用户名和密码获得相应的权限,在远程管理计算机和查看计算机的共享资源时使用。   利用IPC$,连接者甚至可以与目标主机建立一个空的连接而无需用户名与密码(当然对方机器必须开了ipc$共享,否则你是连接不上的),而利用这个空的连接,连接者还可以得到目标主机上的用户列表(不过负责的管理员会禁止导出用户列表的)。   我们总在说ipc$漏洞ipc$漏洞,其实ipc$并不是真正意义上的漏洞,它是为了方便管理员的远程管理而开放的远程网络登陆功能,而且还打开了默认共享,即所有的逻辑盘(c$,d$,e$……)和系统目录winnt或windows(admin$)。   所有的这些,初衷都是为了方便管理员的管理,但好的初衷并不一定有好的收效,一些别有用心者(到底是什么用心?我也不知道,代词一个)会利用IPC$,访问共享资源,导出用户列表,并使用一些字典工具,进行密码探测,寄希望于获得更高的权限,从而达到不可告人的目的。 ipc$与空连接、139、445端口、默认共享的关系   以上四者的关系可能是菜鸟很困惑的一个问题,不过大部分文章都没有进行特别的说明,其实我理解的也不是很透彻,都是在与大家交流中总结出来的。

Android 进阶之跨进程通信(IPC)

孤街醉人 提交于 2020-01-26 00:18:46
先看一下 Android 中跨进程通信的方式: 名称 优点 缺点 使用场景 Intent 简单易用 只能传输 Bundle 所支持的数据类型 四大组件的进程间通信 文件共享 简单易用 不适合高并发 简单的数据共享,无高并发场景 AIDL 功能强大,支持一对多并发实时通信 使用稍微复杂,需要注意线程同步 复杂的进程间调用,Android 中最常用 Messenger 比AIDL稍微简单易用些 比AIDL功能弱,只支持一对多串行实时通信 简单的进程间通信 ContentProvider 强大的数据共享能力,可通过call方法扩展 受约束的AIDL,主要对外提供数据线的CRUD操作 进程间的大量数据共享 RemoteViews 在跨进程访问UI方面有奇效 比较小众的通信方式 某些特殊的场景 Socket 跨主机,通信范围广 只能传输原始的字节流 常用于网络通信中 Binder Binder 是 Android 系统进程间通信(IPC)方式之一。 参考: 1. Android Bander设计与实现 - 设计篇 2. 图文详解 Android Binder跨进程通信的原理 Messenger Messenger 是一种轻量级的 IPC 方案并对 AIDL 进行了封装,它实现起来比较容易。 参考: 用Messenger进行进程间通信 AIDL 在 AIDL 文件中支持的数据类型包括:

Check if a IPC message queue already exists without creating it

南笙酒味 提交于 2020-01-25 21:13:12
问题 How can I just check if a message queue exists or not without making it? When using msgget with O_CREAT | O_EXCL flag, if it exists, the call will fail with return value -1, but if it doesn't, it will then create a new message queue. Is there any way to just check? 回答1: ipcs(1) provides information on the IPC facilities and ipcrm(1) can be used to remove the IPC objects from the system. List shared memory segments: ipcs -m List message queues: ipcs -q Remove shared memory segment created with

dll to main program communication

房东的猫 提交于 2020-01-25 02:24:05
问题 I want to trace some text from dll module to a main program window (to a log subwindow). How can I do this correctly? (through kernel primitives, via sending messages from window to window, passing callback interfaces?) The working example I've seen: Matlab and Octave. When calling mexPrintf then output printed in their main windows. 回答1: Your main program should export a logging function and make it known to the DLL. Your DLL needs to export a function, such as InitLogging, that takes a

dll to main program communication

给你一囗甜甜゛ 提交于 2020-01-25 02:23:45
问题 I want to trace some text from dll module to a main program window (to a log subwindow). How can I do this correctly? (through kernel primitives, via sending messages from window to window, passing callback interfaces?) The working example I've seen: Matlab and Octave. When calling mexPrintf then output printed in their main windows. 回答1: Your main program should export a logging function and make it known to the DLL. Your DLL needs to export a function, such as InitLogging, that takes a

IPC$入侵大全

天涯浪子 提交于 2020-01-24 21:40:24
0x01 ipc$的定义 IPC$(Internet Process Connection)是共享"命名管道"的资源(大家都是这么说的),它是为了让进程间通信而开放的命名管道,可以通过验证用户名和密码获得相应的权限,在远程管理计算机和查看计算机的共享资源时使用。利用IPC$,连接者甚至可以与目标主机建立一个空的连接而无需用户名与密码(当然,对方机器必须开了ipc$共享,否则你是连接不上的),而利用这个空的连接,连接者还可以得到目标主机上的用户列表(不过负责的管理员会禁止导出用户列表的)。 0x02 ipc$与空连接,139,445端口,默认共享的关系 ipc$与空连接: 不需要用户名与密码的ipc$连接即为空连接,一旦你以某个用户或管理员的身份登陆(即以特定的用户名和密码进行ipc$连接),自然就不能叫做空连接了. 许多人可能要问了,既然可以空连接,那我以后就空连接好了,为什么还要费九牛二虎之力去扫描弱口令,呵呵,原因前面提到过,当你以空连接登陆时,你没有任何权限(很郁闷吧),而你以用户或管理员的身份登陆时,你就会有相应的权限(有权限谁不想呀,所以还是老老实实扫吧,不要偷懒哟). ipc$与139,445端口: ipc$连接可以实现远程登陆及对默认共享的访问;而139端口的开启表示netbios协议的应用,我们可以通过139,445(win2000)端口实现对共享文件/打印机的访问

Is there an easy way of clearing a pipe in C

喜欢而已 提交于 2020-01-24 06:37:26
问题 I have a pipe that all my child processes use, but before a child uses the pipe to talk to the parent I need to clear it so that the parent reads from it correctly. Is there a simple function in C to do this? 回答1: The way to "clear" a pipe is to read from it until the buffer is empty. This doesn't help you. I am guessing that your real problem is that the parent might read data that is mixed from multiple clients. There are two easy solutions to your problem. Always write messages less than

Is there an easy way of clearing a pipe in C

巧了我就是萌 提交于 2020-01-24 06:37:05
问题 I have a pipe that all my child processes use, but before a child uses the pipe to talk to the parent I need to clear it so that the parent reads from it correctly. Is there a simple function in C to do this? 回答1: The way to "clear" a pipe is to read from it until the buffer is empty. This doesn't help you. I am guessing that your real problem is that the parent might read data that is mixed from multiple clients. There are two easy solutions to your problem. Always write messages less than