diff --git a/os/gproc/gproc_comm.go b/os/gproc/gproc_comm.go index f9014c2a2..9d2bf6aa5 100644 --- a/os/gproc/gproc_comm.go +++ b/os/gproc/gproc_comm.go @@ -31,9 +31,9 @@ type MsgResponse struct { } const ( - gPROC_COMM_DEFAULT_GRUOP_NAME = "" // Default group name. - gPROC_DEFAULT_TCP_PORT = 10000 // Starting port number for receiver listening. - gPROC_MSG_QUEUE_MAX_LENGTH = 10000 // Max size for each message queue of the group. + defaultGroupNameFoProcComm = "" // Default group name. + defaultTcpPortForProcComm = 10000 // Starting port number for receiver listening. + maxLengthForProcMsgQueue = 10000 // Max size for each message queue of the group. ) var ( diff --git a/os/gproc/gproc_comm_receive.go b/os/gproc/gproc_comm_receive.go index 18a815553..df4f52412 100644 --- a/os/gproc/gproc_comm_receive.go +++ b/os/gproc/gproc_comm_receive.go @@ -35,10 +35,10 @@ func Receive(group ...string) *MsgRequest { if len(group) > 0 { groupName = group[0] } else { - groupName = gPROC_COMM_DEFAULT_GRUOP_NAME + groupName = defaultGroupNameFoProcComm } queue := commReceiveQueues.GetOrSetFuncLock(groupName, func() interface{} { - return gqueue.New(gPROC_MSG_QUEUE_MAX_LENGTH) + return gqueue.New(maxLengthForProcMsgQueue) }).(*gqueue.Queue) // Blocking receiving. @@ -52,7 +52,7 @@ func Receive(group ...string) *MsgRequest { func receiveTcpListening() { var listen *net.TCPListener // Scan the available port for listening. - for i := gPROC_DEFAULT_TCP_PORT; ; i++ { + for i := defaultTcpPortForProcComm; ; i++ { addr, err := net.ResolveTCPAddr("tcp", fmt.Sprintf("127.0.0.1:%d", i)) if err != nil { continue diff --git a/os/gproc/gproc_comm_send.go b/os/gproc/gproc_comm_send.go index 762042162..5a06cef62 100644 --- a/os/gproc/gproc_comm_send.go +++ b/os/gproc/gproc_comm_send.go @@ -18,7 +18,7 @@ func Send(pid int, data []byte, group ...string) error { msg := MsgRequest{ SendPid: Pid(), RecvPid: pid, - Group: gPROC_COMM_DEFAULT_GRUOP_NAME, + Group: defaultGroupNameFoProcComm, Data: data, } if len(group) > 0 { diff --git a/os/gproc/gproc_process.go b/os/gproc/gproc_process.go index 870f89cca..625407364 100644 --- a/os/gproc/gproc_process.go +++ b/os/gproc/gproc_process.go @@ -88,7 +88,7 @@ func (p *Process) Run() error { } } -// PID +// Pid retrieves and returns the PID for the process. func (p *Process) Pid() int { if p.Process != nil { return p.Process.Pid @@ -96,7 +96,7 @@ func (p *Process) Pid() int { return 0 } -// Send send custom data to the process. +// Send sends custom data to the process. func (p *Process) Send(data []byte) error { if p.Process != nil { return Send(p.Process.Pid, data)