I am working on an GUI application, the UI is developed using python(+kivy) and the core is implemented using GoLang.
My Application involves passing data from UI to Core, for which i am using pipes. Following is the snippet of Client and Server code.
Client.py:
p = win32pipe.CreateNamedPipe(r'\\.\pipe\test_pipe',
win32pipe.PIPE_ACCESS_DUPLEX,
win32pipe.PIPE_TYPE_MESSAGE |win32pipe.PIPE_WAIT,
1, 65536, 65536,300,None)
win32pipe.ConnectNamedPipe(p, None)
data = "Hello Pipe"
win32file.WriteFile(p, bytes(data,"UTF-8"))
Server.go:
ln, err := npipe.Listen(`\\.\pipe\test_pipe`)
if err != nil {
// handle error
}
for {
conn, err := ln.Accept()
if err != nil {
// handle error
continue
}
// handle connection like any other net.Conn
go func(conn net.Conn) {
r := bufio.NewReader(conn)
msg, err := r.ReadString('
')
if err != nil {
// handle error
return
}
fmt.Println(msg)
}(conn)
}
With the above piece of code, i am not able to setup a connection between them. My Application involves duplex communication between client and server
Any sort of help is appreciated!!