Call a function when new node link is created Is there any way to trigger a function call when a node link is created with another node? The called function should be able to access both the input and output nodes of the link created.

It would be helpful if possible in the Materials node tree and not the Compositor node tree.
If you are writing your own nodes:
Yes! You can add an update-function wich can handle input-tests.
Your update-function will be called on every change of the node, so on linking/unlinking it will be called. Here is how:

class MyNode(bpy.types.Node):
    bl_idname='MyNode'
    bl_label ='MyNode'
    # your update function must only take self
    def update(self):
        # your code here
        for skt in self.inputs:
            if skt.links:
                print("Input socket {} is linked".format(skt.name))


If you are using existent nodes:
No, probably not. You simply can not overwrite the nodes own update-functions.
They seem to be like a read-only-property returning a function to you.
Setting them wont work, no matter what.