Friday, November 23, 2012

localconnection

localconnection:
@@ -1 +1,218 @@
+ Hiring an experienced search engine consultant [[http://www.dongaconnet.com|Search Engine Consulting]]can build or break a business.
+ Search Engine Consulting (SEO Consulting) is the strategy of improving the visibility of a dental practice website pages in search engine results using non pay-per-click (PPC) or organic “natural” methods.
+
+ Going beyond the search engine basics starts by applying the process of search engine marketing (SEM) tactics to move the visibility of a website or a web page higher in the search engine result pages (SERPS) for the purpose of attracting higher rankings which results in more traffic to a website.
+
+ The real search terms or “keywords” people use to find dental products, dental services and dental practice information online can be highly competitive. In order to rise in the rankings a dental practice website must be optimized and the content edited to remove any potential search engine blocks. These search engine consultants look for and repair any website features that could hold back the indexing or a website in the search engine result pages.
+
+ Search engine consultants need to know exactly how the changes they make will affect a websites ability to be indexed in the search engines. A specific search engine balance has to be achieved; otherwise over dental practice website optimization could attract penalties from the search engines or worse get a website banned from the internet.
+
+ Search engine Consultants provide useful services for website owners and will review your site content and structure offering technical advice on website development, hosting, redirects, fixing broken or missing pages and the use of website code technologies like JavaScript correctly.
+
+ In addition to knowing and recommending useful search engine optimization and web technologies, an expert search engine consultant will also be able to help you in developing your content and managing your internet marketing campaigns, keyword research, search engine consulting, search engine training and expanding your search engine visibility in specific search markets and geographies.
+ While search engine consultants can provide clients with valuable services, some unethical Search engine consultants have given the industry a black eye through their overly aggressive marketing efforts and their attempts to manipulate search engine results in unfair ways. Practices that violate our guidelines may result in a negative adjustment of your site's presence in Google, or even the removal of your site from our index. Here are some things to consider:
+
+ Website owners need to avoid these “Black Hat” search engine optimization consulting tactics and strategies. The obvious sign for the non technical business owner searching to understand who to trust is this. If it sounds too-good-to-be-true then it usually is. Search engine success takes time to achieve search engine rankings for your targeted keywords.
+
+ There are a few strategies that you can use in doing your search engine due diligence that will help keep you from losing a lot of time, effort, and money when choosing a great search engine consultant for your search engine visibility needs. It’s important to become an educated consumer and get familiar with the best practices for improving your websites search engine relationship.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ===== The Win32 implementation =====
+
+ **Notes:**
+ * the LocalConnection is very OS-dependent but it should be similar for the Linux and Mac systems. Feel free to describe other implementations.
+ * these information & code samples work with Flash 6, 7 and 8 SWFs.
+ * these observations and sample codes may not be a very reliable source for you own developments!
+
+ \\
+
+ === Spying Flash ===
+
+ So I made a dummy SWF which calls some dummy method from a dummy LocalConnection.
+
+ To know what's going on when the LocalConnection is created, you can use some tool to spy the Flash player. I used the great and free [[http://www.sysinternals.com/Utilities/ProcessExplorer.html|Systernal's ProcessExplorer]].
+
+ {{http://philippe.elsass.free.fr/drop/localconnection/processexplorer.gif}}
+
+ The Process Explorer shows us all the kernel objects owned by SAFlashPlayer.exe. We can see two new items that where not here before the creation of the LocalConnection:
+
+ ^ Type ^ Name ^
+ | Section | \BaseNamedObject\MacromediaFMOmega |
+ | Mutant | \BaseNamedObject\MacromediaMutexOmega |
+
+
+ === What does that mean? ===
+
+ It means that Macromedia simply uses the most common and reliable way to exchange data between process.
+
+ * **MacromediaFMOmega** is the name of a File Mapping object. It is a memory file that can be shared by several processes (i.e. applications, plug-ins, etc.),
+ * **MacromediaMutexOmega** is the name of a Mutex object. It's role is to make sure that only one and only process will have access to the FileMapping.
+
+
+ === How does it work ===
+
+ The good news is that any application that knows the name of a kernel object can have access to it. So technically, if you can call Win32 API functions, you will be able to fake a LocalConnection.
+
+ **Listening**
+
+ To create a listening LocalConnection, you just have to set a thread to:
+ - register the application as a valid LocalConnection listener,
+ - require the mutex to have exclusive access to the shared memory,
+ - access the shared memory and check the recipient,
+ - if you are the recipient, read the message and mark it read,
+ - release the shared memory and the mutex,
+ - repeat indefinitely from step **2.**
+
+ \\
+ Accessing the memory is the easy part. The tough part will be to “read the message” because the LocalConnection can be used to send complex data. These data are encoded as AMF data types, so you will have to check [[amfphp]] (PHP), [[flap]] (Perl) or [[http://www.teslacore.it/wiki/index.php?title=AMFPP|AMFPP]] (C++) sources to decode the messages.
+
+ **Sending**
+
+ To send a message to a LocalConnection apparently works like that:
+ - require the mutex to have exclusive access to the shared memory,
+ - access the shared memory and check that the listener is connected,
+ - if the recipient is registered, write the message,
+ - release the shared memory and the mutex.
+
+ \\
+ The main thing you have to care about is the timestamp - simply call GetTickCount() - and the message size. If your message is correctly encoded, it should be received by the listening LocalConnection.
+
+
+
+
+ === Memory format ===
+
+ Some facts:
+ * The header is 16 bytes,
+ * The message can be up to 40Ko,
+ * The listeners block starts at 40Ko+16 = 40976 bytes,
+ * To add a listener, simply append its name in the listeners list (null terminated strings)
+
+ \\
+ ^ HEADER ^^
+ | unsigned long | unknown |
+ | unsigned long | unknown |
+ | unsigned long | timestamp((The number of milliseconds that have elapsed since Windows was started)) |
+ | unsigned long | message size |
+ ^ MESSAGE ^^
+ | AMF string | connection name |
+ | AMF string | protocol |
+ | AMF string | method name |
+ | any AMF type | message data |
+ | ... ||
+ ^ LISTENERS ^^
+ | string | connection name |
+ | ... ||
+
+ For more detailed AMF format info look here:\\
+ http://vanrijkom.org/archives/2005/06/amf_format.html
+
+
+
+
+ == Linux implementation ==
+
+ This describes the implementation on Linux. It may also clarify some points for the Windows section, particularly on data expiry and listener markers.
+
+ As on Windows, the shared memory section is divided into an initial data section and a listeners section. The listeners section begins at 40976 bytes: the same as on Windows.
+
+ The header is the same as on windows. It comprises the eight bytes:
+
+ 01 00 00 00 01 00 00 00
+
+ followed by a long timestamp and a long data length value. The timestamp is the number of milliseconds since the flashplayer started. This is not the same as what is documented for Windows.
+
+ Data may not be overwritten while the timestamp and length fields are not zero.
+
+
+ === Sending ===
+
+ Sending comprises two stages: checking whether the buffer may be written, and writing the data.
+
+
+
+ ** Expiry check **
+
+ A sender checks the timestamp and length fields any data in the buffer. If they are zero, the data may be overwritten and we can proceed to write our data. If they are non-zero, the sender checks whether it can be marked as expired
+
+ Data expires after 4 seconds. Processes only delete data they (think they) wrote. If the timestamp matches the timestamp of the last data that the sender wrote, it assumes it can invalidate the data. If the timestamp is more than 4 seconds old, the sender overwrites the timestamp and length with zero. This means it may be overwritten.
+
+ If the data has not expired, the sender continues to check whether the data has expired as long as the data is not marked for overwriting. No changes are made to the buffer by a sender as long as the timestamp is there.
+
+
+
+ ** Writing the data **
+
+ Once the buffer is ready for writing, the sender checks if the correct listener is present by searching the listeners section for the name of the connection. If the name is found, the sender writes the first message in its queue and stores the messages timestamp. If the listener is not present, the sender iterates through the queue until a message for an existing listener is found.
+
+ If none is found, the last message in the buffer is sent with no timestamp. (It's not clear if there's any point in sending it, but it happens).
+
+
+
+ === Receiving ===
+
+ A listener registers itself by adding its name to the listeners section of the shared memory. The name is null-terminated and followed by a
+ further marker, which is of the form:
+
+ 3a 3a 33 00 3a 3a 34 00
+ : : 3 : : 4
+
+ The numbers vary, e.g. ::3::4, ::3::1, ::3::2. We do not know the significance of these numbers, though they seem to be related to the domain of the SWF (http, local etc).
+
+ A listener merely checks whether the data has a timestamp and if the data is intended for it (by reading the first string field). If it is,
+ the data is deserialized, the encoded function called, and the datamarked for deletion.
+
+ Functions are encoded in a particular order after the timestamp and length
+ fields:
+ - connection name (domain:connection) [string]
+ - domain [string]
+ - The following optional data:
+ - [boolean] (always false?)
+ - [boolean] (always false?)
+ - [number] (e.g. 0, 1)
+ - [number] (e.g. 8, 6)
+ - Sometimes the filename [string]. The presence of this (and possibly further arguments) may depend on the first number.
+ - The name of the function to call.
+ - The arguments in reverse(!) order.
+
+ === Notes ===
+ - We don't know what happens when data from another process is left in the buffer with a timestamp. Does it ever get overwritten?
+ - The timestamp seems to be allocated when LocalConnection.send is called, even though the message may be sent much later.
+
+ === Sample applications ===
+
+ // License for the following sources: Public domain.//
+
+ **UPDATE 2007/05/31: bidirectional communication**
+
+ This code sets a bidirectional local connection between an EXE file (ANSI C implementation) and a SWF. When the SWF sends a text message, the EXE sends a message back.
+
+ * [[http://philippe.elsass.free.fr/drop/localconnection/sample.zip|Download executables, C and FLA source]]
+ * [[http://philippe.elsass.free.fr/drop/localconnection/localconnect.c|Download source]]
+
+ **ARCHIVE: listener**
+
+ Here is a sample ANSI C application which registers itself as a listening LocalConnection.
+
+ * [[http://philippe.elsass.free.fr/drop/localconnection/lc.c|Download source]]
+
+ **ARCHIVE: sender**
+
+ Here is a sample ANSI C application which waits for a LocalConnection to register itself as a listening LocalConnection.
+
+ * [[http://philippe.elsass.free.fr/drop/localconnection/lcwrite.c|Download source]]




DIGITAL JUICE

No comments:

Post a Comment

Thank's!