요새 포스팅도 안하고 해서 반성의 시작으로 한번 해 본 코드..

좀 간단하게;;

서버는 Java로 구성해봤는데.. ㅠㅠ

단지 테스팅용으로..  한거니까 다른 분들 들어오시면 돌 던지지마세요 ㅠㅠ

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;

namespace JavaServerTest
{
    public partial class Form1 : Form
    {
        IPEndPoint ipEP;
        Socket socket = null;
        IPHostEntry ipHE;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            System.Console.WriteLine("프로그램 시작 윈도우 폼 활성화");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Encoding encString = Encoding.GetEncoding(949);
            byte[] d_byte = new byte[1024];
            socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            //ipHE = Dns.GetHostByName("127.0.0.1");
            ipEP = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8520);
            socket.Connect(ipEP);
            string s_data = "Client Start";

            d_byte = encoding.GetBytes(s_data);
            System.Console.WriteLine("보낼 준비");
            socket.Send(d_byte);

            byte[] R_byte = new byte[1024];
            System.Console.WriteLine("받을 준비");
            int size = socket.Receive(R_byte);
            System.Console.WriteLine(encString.GetString(R_byte, 0, size));
            socket.Close();
        }
    }
}

여기까지가 클라이언트!!

말 그대로 간단하다;;

요새 공부를 안했더니.. 좀 더 발전해야하는데...