It complains because you are doing something it thinks is silly! And, in truth it is.
dim recievedData as string
sckClient.GetData(recievedata)
You declare a variable "recievedData" and then call a function with it as a parameter.
Because you do not assign a value at any point between the declaration and the use, the compiler knows that the value entering the function will be null - it will give it that when you declare it.
Because the method "GetData" does not use a
ref
paramater, the value in "recievedData" can only go into the function - nothing that happens to it in the function can be returned, so "recievedData" will always wtill be null after the function call.
What you need to do is modify the GetData functionso that either it returns a string, which you assign to recievedData:
dim recievedData as string
recievedData = sckClient.GetData()
or make the parameter ByRef if you are going to assign it in the function:
Private Sub GetData(ByRef str As String)
...
str = "hello"
End Sub