Null help.

12/24/2010 12:41 Santa#1
Alright, i don't know why i had my last thread closed, I guess I thought I could handle is.

I have been at this problem literally all day and have tried 4 different socket wrappers and they all have the same issue.

PHP Code:
Console.WriteLine("Incoming Auth Data");
AuthClient sender Sender.Wrapper as AuthClient
sender.AuthServer.Send(Data); 
This is currently Hybrids socket that were upgraded for 5018+
sender is ALWAYS null so when i try to send the data it throws the null exception. My question is is how come it is null and won't 'define' as a AuthClient. If it helps this is my AuthClient class

If you could help that would be wonderful.

Thanks
12/24/2010 13:18 Nullable#2
I think this is happening because you're not setting the Wrapper member in WinsockClient to the AuthClient instance.
Code:
AuthServer.Wrapper = this
However it is irrelevant, why are you using the Sender.Wrapper instead of directly using 'this' keyword? You're essentially in a member function of the same class.
12/24/2010 16:26 KraHen#3
If sender is null that means that Wrapper can`t be casted to AuthClient. Check why they`re not compatible in your code.
12/24/2010 17:38 pro4never#4
To clear up what they are saying some... go to where you have your on connect method and set the wrapper to the instance of the auth client object you create...

IE on connect you'd be doing something like...

Sender.Wraper = new AuthClient(Socket, Port);

that way the wrapper is not null and you can therefor use it when receiving packets from that client.
12/24/2010 22:55 Santa#5
I do set it to an instance if the auth client

Sender.Wrapper = new AuthClient(Sender); Within the AuthConnect.

Edit:
Here is my connections class
12/26/2010 13:37 InfamousNoone#6
That's strange PM me your MSN or something, I wouldn't mind helping you debug it.