



Package msg provides a way to use System V message queues.
go get github.com/hslam/msg
import "github.com/hslam/msg"
msgsnd
package mainimport ("github.com/hslam/ftok""github.com/hslam/msg""time")funcmain() {key,err:=ftok.Ftok("/tmp",0x22)iferr!=nil {panic(err)}msgid,err:=msg.Get(key,msg.IPC_CREAT|0600)iferr!=nil {panic(err)}defermsg.Remove(msgid)err=msg.Send(msgid,1, []byte("Hello World"),0600)iferr!=nil {panic(err)}time.Sleep(time.Second*10)}
msgrcv
package mainimport ("fmt""github.com/hslam/ftok""github.com/hslam/msg")funcmain() {key,err:=ftok.Ftok("/tmp",0x22)iferr!=nil {panic(err)}msgid,err:=msg.Get(key,0600)iferr!=nil {panic(err)}text,err:=msg.Receive(msgid,1,0600)iferr!=nil {panic(err)}fmt.Println(string(text))}
This package is licensed under a MIT license (Copyright (c) 2020 Meng Huang)
msg was written by Meng Huang.