using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
public class Client : MonoBehaviour
{
public string ipAddress = "127.0.0.1";
IPAddress ip;
Socket socket;
// Use this for initialization
void Start()
{
ip = IPAddress.Parse(ipAddress);
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect(new IPEndPoint(ip, 8885));
}
// Update is called once per frame
void Update()
{
}
void OnGUI()
{
if (GUI.Button(new Rect(0, 20, 100, 20), "Connect"))
{
socket.Send(Encoding.ASCII.GetByte