Object refernce not set to an instance of an object error, not sure why

I have code in a .dll that a game in unity3d uses to connect to the server. and for some reason when the code in unity3d uses the code in the .dll it says object refernce no set to an instance of an object.  Why is it throwing this error? im declaring everything before using it.

code in .dll

        public void Start(string IP,int Port)
        {
            
            try
            {
                keyHandeler.create();
                TcpClient socket = new TcpClient();
                socket.Connect(IP, Port);
                st = socket.GetStream();
                Connection(true);
            }
            catch { Connection(false); }
        }

code in unity3d

        Client server = new Client();
        void Start () 
        {
             server.Start(IP, Port); // throws the object reference not set to an instance of an object
             // other stuff after this but it never reaches them
	}
Object refernce not set to an instance of an object error, not sure why
===


I have code in a .dll that a game in unity3d uses to connect to the server. and for some reason when the code in unity3d uses the code in the .dll it says object refernce no set to an instance of an object.  Why is it throwing this error? im declaring everything before using it.

code in .dll

        public void Start(string IP,int Port)
        {
            
            try
            {
                keyHandeler.create();
                TcpClient socket = new TcpClient();
                socket.Connect(IP, Port);
                st = socket.GetStream();
                Connection(true);
            }
            catch { Connection(false); }
        }

code in unity3d

        Client server = new Client();
        void Start () 
        {
             server.Start(IP, Port); // throws the object reference not set to an instance of an object
             // other stuff after this but it never reaches them
	}