Phoenix.Socket.Transport get the websocket transport.pid

hello,

using custom protocol over @behaviour Phoenix.Socket.Transport

how to retrieve the real pid associated with the socket, as transport.pid?

thanks

1 Like

Just to make sure, do you want access to socket pid from within callback functions of Phoenix.Socket.Transport? If so, try self().

The problem Is that onconnect, onmsg, on_disconnect using a monitor, the self() differs on the same websocket

I know that Channel expose transport.pid

I Need to retrieve the transport.pid in socket.transport too

Can you please post your custom websocket transport here with comments indicating where you need the pid?

Also if all you want is to monitor the socket process, you don’t need to have a write transport for it.