How to Receive a Message through Named Pipe
This sample demonstrates how to receive a message using the named pipe of the Info service.
File ReceiveMessage.vbs used in this sample is located in the folder:
C:\Program Files\CodeSegment\SMS Studio\Samples\InfoService
This script opens a named pipe instance and sends a messages that
will be placed in the SMS Studio Inbox and then processed as if it was received through an
ordinary connection.
The contents of the ReceiveMessage.vbs file:
PipeName = "ReceivePipe"
set fso = CreateObject("Scripting.FileSystemObject")
set pipe = fso.CreateTextFile("\\.\pipe\" & PipeName)
pipe.WriteLine("From: +44446666")
pipe.WriteLine("To: 7777")
pipe.WriteLine("AccountID: Emulator #1")
pipe.WriteLine("Body: Test message.")
pipe.WriteLine("NewLine: This is a new line.")
pipe.WriteLine("<Receive>")
pipe.Close
WScript.Quit(0)
How to run this sample
- Click the New button on the main toolbar and select the Info service option in the New Service dialog.
- Click the Setup button on the main toolbar to display the Info Setup dialog.
- In the Advanced tab enter the name of the pipe:
Pipe name: ReceivePipe
- Click the OK button to close the Info Setup dialog.
- Open Windows Explorer and locate the
ReceiveMessage.vbs file. Double-click on this file to run the script.
- Check the Inbox window to see that the test message has been received.
Related topics
Named Pipe