-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Description
I'm having an odd issue that I can't seem to be able to solve.
In my program I have a main unix socket that accept message and within the same program I have cli that create a socket and write to the main socket. The connection to main has no issues, it's when I write, the main socket error out with Error code: -9993(0x-2709), Invalid argument
Main Socket:
func attach() async {
do {
try socket.listen(on: socketPath)
log.info("Listening on \(socketPath)")
while true {
let socket = try Socket.create(family: .unix, type: .stream, proto: .unix)
let conn = try socket.acceptClientConnection()
let msg = try conn.readString()?.trimmingCharacters(in: .whitespacesAndNewlines)
conn.close()
// await .......
}
} catch { log.error("Socket error: \(error)") }
}CLI socket write:
do {
let socket = try Socket.create(family: .unix, type: .stream, proto: .unix)
try socket.connect(to: socketPath)
try socket.write(from: "-d restart")
return
} catch { ... }Metadata
Metadata
Assignees
Labels
No labels