public void requestInfo(String type) { switch (type) { case "chatrooms": JObject roomsPacket = new JObject( new JProperty("CMD", "requestinfo"), new JProperty("Type", type)); var json1 = roomsPacket.ToString(); byte[] data1 = Packet.CreateByteData(json1); this.Send(data1); break; case "users": JObject usersPacket = new JObject( new JProperty("CMD", "requestinfo"), new JProperty("Type", type)); var json2 = usersPacket.ToString(); byte[] data2 = Packet.CreateByteData(json2); this.Send(data2); break; } }