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.

37 lines
778 B
Go

2 years ago
package main
import (
"fmt"
"go-dde/dde"
2 years ago
. "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])
2 years ago
fmt.Printf("data: %v\n", data)
ddecli.Poke(ddecli.HszItem[i], data)
2 years ago
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()
}
2 years ago
func main() {
//runClient()
runServer()
2 years ago
}