If you detect someone trying to connect to a certain port you are listening on via /socklisten, you can accept the connection with /sockaccept, after which the $sock identifier becomes available to give you information.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius