You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"go-dde/dde"
|
|
|
|
. "go-dde/types"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func runClient() {
|
|
|
|
ddecli := dde.DdeClient{}
|
|
|
|
ddecli.AppName = "Server"
|
|
|
|
ddecli.TopicName = "MyTopic"
|
|
|
|
ddecli.Items = []VString{"MyItem0", "MyItem1", "MyItem2", "MyItem3", "MyItem4", "MyItem5", "MyItem6"}
|
|
|
|
ddecli.Run()
|
|
|
|
for i := 0; i < len(ddecli.Items); i++ {
|
|
|
|
data := ddecli.Request(ddecli.HszItem[i])
|
|
|
|
fmt.Printf("data: %v\n", data)
|
|
|
|
ddecli.Poke(ddecli.HszItem[i], data)
|
|
|
|
time.Sleep(1e9)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func runServer() {
|
|
|
|
ddeser := dde.DdeServer{}
|
|
|
|
ddeser.AppName = "Server"
|
|
|
|
ddeser.TopicName = "MyTopic"
|
|
|
|
ddeser.Items = []VString{"MyItem0", "MyItem1", "MyItem2", "MyItem3", "MyItem4", "MyItem5", "MyItem6"}
|
|
|
|
defer ddeser.DestoryServer()
|
|
|
|
ddeser.RunServer()
|
|
|
|
}
|
|
|
|
func main() {
|
|
|
|
//runClient()
|
|
|
|
runServer()
|
|
|
|
|
|
|
|
}
|