Is there a way to detect whether a socket.socket instance passed to a function that already has the connection setup is a server-side socket (Executed socket.accept()) or is a client-side socket (Executed socket.connect().
Basically I'm looking for something to check about the socket to implement is_server_socket being used below:
def func(sock):
if is_server_socket(sock):
print("I'm a server!")
else:
print("I'm a client!")