public static SocketObject DeSerializeRawSocketStream(string text1) { SocketObject obj3 = null; int num = 0; string str = ""; if (text1.Length > 0) { str = CommonFunction.substring(text1, 0, "[*Name#]", "[/*Name#]", ref num); if (num > -1) { obj3 = new SocketObject(str); obj3.set_Action((SocketEnumCollection.eSocketObjectAction) ((int) Math.Round(Conversion.Val(CommonFunction.substring(text1, 0, "[*Action#]", "[/*Action#]", ref num))))); obj3.set_Value(CommonFunction.substring(text1, 0, "[*Value#]", "[/*Value#]", ref num)); } } return obj3; }
public void SendMessageToServer(string text1) { if (this._objClient.Connected) { SocketObject obj2 = new SocketObject(this._strClientName, SocketEnumCollection.eSocketObjectAction.Message, text1); byte[] bytes = Encoding.ASCII.GetBytes(SocketDeserializer.SerializeRawSocketStream(obj2)); this._objServerStream = this._objClient.GetStream(); this._objServerStream.Write(bytes, 0, bytes.Length); this._objServerStream.Flush(); } }
public void SendMessageToServer(SocketObject obj1) { if (this._objClient.Connected) { byte[] bytes = Encoding.ASCII.GetBytes(SocketDeserializer.SerializeRawSocketStream(obj1)); this._objServerStream = this._objClient.GetStream(); this._objServerStream.Write(bytes, 0, bytes.Length); this._objServerStream.Flush(); } }
public static string SerializeRawSocketStream(SocketObject obj1) { return string.Format("[*Name#]{0}[/*Name#][*Action#]{1}[/*Action#][*Value#]{2}[/*Value#]", obj1.get_Name(), Conversion.Val(obj1.get_Action()), obj1.get_Value()); }