Exemple #1
0
func receiveExitStatus(commandUsock *unixsocket.Usock, err error) (string, error) {
	if err != nil {
		return "", err
	}

	return commandUsock.ReadMessage()
}
Exemple #2
0
func receivePidFromCommand(commandUsock *unixsocket.Usock, err error) (int, error) {
	if err != nil {
		return -1, err
	}

	msg, err := commandUsock.ReadMessage()
	if err != nil {
		return -1, err
	}
	intPid, _, _ := messages.ParsePidMessage(msg)

	return intPid, err
}
Exemple #3
0
func receiveCommandArgumentsAndPid(usock *unixsocket.Usock, err error) (string, int, string, error) {
	if err != nil {
		return "", -1, "", err
	}

	msg, err := usock.ReadMessage()
	if err != nil {
		return "", -1, "", err
	}
	command, clientPid, arguments, err := messages.ParseClientCommandRequestMessage(msg)
	if err != nil {
		return "", -1, "", err
	}

	return command, clientPid, arguments, err
}