OMCS development manual (04) -- secondary development process OMCS development manual (00) -- Overview

Source: Internet
Author: User
Document directory
  • 1. Basic Process
  • 2. Notes

After mastering the previous articles (overview, multimedia manager, multimedia connector, and multimedia server) about OMCS, we can perform secondary development based on OMCS. Next we will introduce the development steps from the server and client perspectives.

1. Server Development

Aside from the specific business logic, OMCS server development is quite simple. The procedure is as follows:

(1) download "OMCS Multimedia Server (with source code)" from the official website )".

(2) Use VS to open the OMCS. Server project, modify the implementation of the UserVerifier class, and add the logic for verifying the password of the client user account for the VerifyUser method.

(3) If you need to use a custom main form, implement it.

(4) modify the configuration in App. config.

(5) release, deploy, and run the project.

As described in the OMCS development manual (00)-The OMCS multimedia server and the Application Server implementing business logic are independent of each other.

We can also integrate the specific business logic in the OMCS server process to merge the two processes into one. However, we do not recommend this because we need to deploy them separately when the load increases. In addition, the advantage of separate deployment is to avoid mutual interference between them.

 

2. Client development

Compared with the OMCS server, client development is a little more complex.

1. Basic Process

(1) Add references to OMCS. dll, PaintFramework. dll, and ESBasic. dll in the project. For a WPF application, you also need to add a reference to OMCS. WPF. dll.

(2) Add the connector components/controls of OMCS to the toolbox: Right-click the blank area of the toolbox of VS and Choose Shortcut> select item, in the pop-up "select toolbox items" form, click "Browse" and select OMCS. dll file, and then click "OK ".

(3) Start encoding. Call the static method GetSingleton of MultimediaManagerFactory to obtain the multimedia manager single-piece instance, set the attributes of the multimedia manager, and call the Initialize method to complete initialization.

(4) drag a connector component from the toolbox to the surface of your form or control.

(5) Call the BeginConnect method of the connector to connect to the target multimedia device and schedule its ConnectEnded event to obtain the connection result.

(6) determine the Disconnected event of the connector. When the connection of the connector is Disconnected, obtain the notification and handle it accordingly.

(7) When the business logic requires that the connector be hung up or the host form be closed, you need to call the Disconnect method of the connector to actively Disconnect the connection to the target multimedia device.

2. Notes

Pay special attention to one issue during client development. As shown in "integration with OMCS", the client will have two connections, one connecting to the OMCS server, and the other connecting to the application server. Which of the following determines whether the client is online or offline? There are two common strategies.

(1) The connection to the application server is the main factor.

Generally, the client status is dominated by the connection of the application server. For example, when the connection to the application server is disconnected, the client is displayed as "offline". When the connection to the application server is successful, the client displays "online ".

If this policy is used, it is usually used to connect to the OMCS server after the client successfully logs on to the Application Server (that is, call the Initialize method of IMultimediaManager) during programming ), in this case, there may be a time gap-that is, the application server has been successfully connected, and the OMCS server has not been connected.

The existence of this gap may lead to a new situation: if other Guest clients want to access the multimedia devices of the current client, the TargetUserOffline result will be returned and the connection fails. In this case, the client user as the guest will be very puzzled: it is clear that the other party has been online, however, connecting to the other party's multimedia device, but returns TargetUserOffline. What is the problem? To address this new situation, we can set the WaitOwnerOnlineSpanInSecs attribute of the connector to a slightly larger value, such as 10 seconds, to wait until the multimedia manager of the client as the Owner is initialized successfully.

(2) connection between the application server and the multimedia server

We can also use a more secure policy, that is, the client is displayed as "online" only when the connection between the application server and the multimedia server is normal. When one of the connections is disconnected, the client is displayed as "offline. In this way, there will be no gap between the above statuses due to non-synchronization.

Policy (1) and (2) have their own advantages and disadvantages. Using Policy (1), Client Login will be faster, but there will be two problems arising from inconsistent connection statuses; Policy (2) will not encounter connection inconsistencies, however, logon is slow because both connections are successful and the multimedia manager enters the "online" status after initialization.

In addition to these two commonly used policies, we can also choose a solution that suits our needs.

 

This is the process of OMCS-based secondary development and what you should pay attention to. It is very simple, isn't it. Next, we can refer to the source code of each OMCS demo to learn more about the above process.

 

Read more articles in the OMCS development manual.

Certificate -----------------------------------------------------------------------------------------------------------------------------------------------

Download the free version of OMCS and demo source code

For any questions about OMCS, please contact us:

Tel: 027-87638960

Q: 168757008

Mail: master@oraycn.com

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.