UNIX domain socket

Source: Internet
Author: User
Tags unix domain socket

To enable the write sub-thread in dm365 to pass NALU to dogetnextframe () of live555.

Encode in dm365ProgramIt is based on multiple threads, while live555 is based on the SELECT query mechanism. In order to implement the encode data transfer to live555, it is sent through the live555 encapsulation RTP package. Data interaction has become a problem that you need to think about.

In the paper "Implementation of Embedded Real-Time Streaming Media Server", I saw the unix_domain_socket. The author used it to transmit data between two processes, which is similar to what I have encountered.

**************************************** ************* **************************************** ********

Http://en.wikipedia.org/wiki/Unix_domain_socket

A Unix domain socket or IPC socket (inter-process communication socket) is a data communications endpoint for
exchanging data between processes executing within the same host operating system. while similar in functionality tonamed pipes, Unix domain sockets may be created asbyte
streams or asdatemedisequences, while pipes are byte streams only. processes Using Unix domain sockets do not need to share a common ancestry. theapi
for Unix domain sockets is similar to that of aninternet socket, but does not use an underlying network protocol for communication. the Unix domain socket
facility is a standard component ofposixoperating systems.

UNIX domain sockets use the file system as address
Name Space. They are referenced by processes
Inodes in the file system. This allows two processes to open the same socket in order to communicate. However, communication occurs entirely within the operating system kernel.

In addition to sending data, processes may send
File descriptors into ss a Unix domain socket connection usingSendmsg ()AndRecvmsg ()System CILS.

**************************************** ************* **************************************** ********

(The current time is on Sunday)

For Unix domain socket, I understand that it uses sockets to implement communication between processes in UNIX.Similar to pipe CommunicationHowever, this communication method can be implementedBidirectional full-duplex communicationAnd does not involve underlying things such as the network protocol stack, so I think itNo package splittingThis is annoying.

currently, my method is to create a Unix domain Socket socket in dogetnextframe () of live555, add the socket to the SELECT query mechanism of live555 (when the socket is readable, determine whether it is the NALU data sent back by dm365), and then send the NALU request message to the write thread of dm365. In the write thread of the dm365 Development Board, the Select + nonblocking mechanism is used to listen on whether there is NALU from live555
request information. If yes, then wait for a complete NALU in the write thread and send it to live555.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.