Software developers must know what API or SDK means. Since iPush Server is a middleware, a developer has to pick any iPush API suit with the programming language or tool he/she uses to develop an iPush application.
For high accessibility, ICE Technology provides various kinds of APIs to support main stream run-time environments and programming languages:
There are high consistency functions for easy learning and porting between different APIs.
All API packages listed above can be downloaded from this site. And all packages have sample program (with source code) and prgramming guide included.
Login to iPush BackOffice for creating a new service and new users, then run the sample program immediately to connect to iPush Server and start to taste the way of send-and-receive messages.
We will illustrate the steps for tasting iPush messaging later in this page.
Then open and check the sample program source code in your programming tool. You may also see the respective programming guide on methods, events, properties, and others for reference.
Following figure displays the command and data flows of one-to-many message broadcasting with iPush (applies Pub/Sub messaging model):

The programming skeleton of data sending and receiving with iPush API would like the table below:
| Data sender programming skeleton | Data receiver programming skeleton | |
|---|---|---|
| 1. | ipushTCPConnect() Connect to iPush Server with TCP. |
ipushTCPConnect() Connect to iPush Server with TCP. |
| 2. |
|
ipushSubSubject() Subscribe specific subject to iPush Server. |
| 3. | ipushSendNPSubjectData() Send data to iPush Server with specific subject. |
|
| 4. | onSubjectMessage()* After receives the data pushed from iPush Server, the client API will trigger this event for data handling in application. |
onSubjectMessage()* : the name of the callback function (event) on receiving a subject message gets a slight difference between APIs.
Of course, one iPush application can play both data sender and receiver roles which would adopt these two programming skeletons.
Background information about server, service, and users
We have created one service and two users on public iPush Server of Push4Free with the following informtion. So you don't have to worry about the installing and configuring of iPush Server. It already there for you to taste.
Server
Service
User 1
User 2
The read/write permissions tell both boy and girl can send and receive data on subject push4free.taste.room1, illustrates the basic concept of implementing real-time chatroom with iPush.
Download API package - take ActiveX Control for reference
Please download the latest iPush ActiveX Control API (ActiveX.zip). Then extract the zip file to any folder of your Windows system (say C:\taste) and open the subfolder ActiveX. It should look like this:

The subfolder vx.x.x (v2.4.14 here) means the version number of the iPush ActiveX Control API - xiPush2.ocx. You have to register it first.
Register xiPush2.ocx
Open [Start] / [Run] in your Windows system. Use the regsvr32 command to register the ActiveX control file xiPush2.ocx, like this:
If it does success, you can see the following message:

Run sample program - ActiveXSubjectSample.exe
1. Please open subfolder Samples and run two instances of ActiveXSubjectSample.exe. One for boy, the other for girl.


Input the respective information for connecting to public iPush Server, then press [Connect TCP] in both instances.
If connect and login to iPush Server successfully, you may see the responding message respectively:
Connect with TCP: Server[www.push4free.com], Port[8000], Group[push4free], Product[taste], User[boy], Password[boy]
Connect with TCP: Server[www.push4free.com], Port[8000], Group[push4free], Product[taste], User[girl], Password[girl]
=> method ipushTCP("www.push4free.com", 8000, "push4free", "taste", "boy", "boy") called
=> method ipushTCP("www.push4free.com", 8000, "push4free", "taste", "girl", "girl") called
2. In instance of gril, input push4free.taste.room1 for subject name, then press [Subscribe subject]:

If subscribe successfully, you may see the responding message:
Receive command msg: [700]push4free.taste.room1 - Subject Command OK
Subscribe to subject [push4free.taste.room1]
=> method ipushSubSubject("push4free.taste.room1") called
3. In instance of boy, input push4free.taste.room1 for subject name, hello, everyone for message, then press [Send subscribe msg]:

If send successfully, you may see the responding message:
Send string (length=15): hello, everyone
=> method ipushSendNPSubjectData("push4free.taste.room1", "hello, everyone") called
4. Soon after iPush Server receives the message sent from boy, it will push the message to girl since she has subscribed the subject push4free.taste.room1.

So the instance of girl will show the responding message upon subject message received:
Subject [push4free.taste.room1] received: (from=3,id=3127,length=15)hello, everyone
=> event SetSubjectData("push4free.taste.room1", "", "hello, everyone", 3, 3127) triggered
Feel free to play more on these two instances or run more ActiveXSubjectSample.exe instances to join the chatting. Have fun.