public void writeSocket(string str) { if (!ready) { Debug.Log("Socket Not Ready to write."); return; } String data = str + "\r\n"; writer.Write(data); writer.Flush(); Debug.Log(data + "was written to stream successfully!"); }