Reputation: 94
So here's my code, I don't understand why my second guard isn't catching the data. As you can see on the debugger the data is the same. Unless I'm blind I cannot see the problem
Upvotes: 2
Views: 42
Reputation: 20004
Data
is bound to the value "hey\n"
, but the {tcp,S,_}
tuple you're receiving has a 3rd element of "HEY\n"
, which does not equal the value of Data
. Change that receive
clause to:
{tcp,S,Data2} ->
or some other unbound variable name — anything other than Data
— and all will be well.
Upvotes: 4