Codice PHP:
    public static void reciveData(NetworkStream stream)
    {
        try
        {
            
Stream str;
            
IFormatter formatter = new BinaryFormatter();
            
str stream;
            
MyClass mc = (MyClass)formatter.Deserialize(str);
            
str.Close();
            
Console.WriteLine(mc.ToString());
        }
        catch (
SerializationException ex) { }
    }
    public static 
void sendData(int x,int y,NetworkStream stream)
    {
        try
        {
            
Stream str;
            
IFormatter formatter = new BinaryFormatter();
            
str stream;
            
formatter.Serialize(str, new MyClass(xy));
            
str.Close();
        }
        catch (
SerializationException ex) { }
    } 
Così non funziona, anche se non da errori ne eccezioni... sapreste trovare il motivo del perchè non funziona?

Anzi scusate, modifico:

Ho notato che il programma lancia un'eccezione sul reciveData... precisamente sul formatter.Deserialize();

come mai?