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
838 B
Go

2 years ago
package main
import (
"fmt"
"time"
"github.com/forget-the-bright/go-dde/dde"
. "github.com/forget-the-bright/go-dde/types"
2 years ago
)
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"}
2 years ago
//defer ddeser.DestoryServer()
2 years ago
ddeser.RunServer()
}
2 years ago
func main() {
//runClient()
runServer()
2 years ago
}