????????????????????????????????????????????????
??????????????????????????????——?????????C#??д????????????C++??д?????????????????????????
????socket ????????????c#
??????????????£?
client.Connect(ipAddress?? port);
byte[] byteData = Encoding.UTF8.GetBytes("????й?");
client.Send(byteData);
client.Close();
??????????????? c++
????recv ????
????char szBuffer[1024];
????nBytesRecv = recv(RemoteSocket?? szBuffer?? 1023?? 0 );
????????????????????
????byte[] byteData = Encoding.Default.GetBytes("????й?")??????UTF8???Default
???????????£?
????C#??????
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
namespace CSharpClient
{
class Program
{
static Socket _clientSocket;
static void Main(string[] args)
{
//???????????IP??????? ????socket???????
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("127.0.0.1")?? 5555); //??д????????IP?????????????IP???????????????IP????軔ConsoleApplication_socketServer?????????????????
_clientSocket = new Socket(ipep.AddressFamily?? SocketType.Stream?? ProtocolType.Tcp);
//??Socket???????????
try
{
_clientSocket.Connect(ipep);
String outBufferStr;
Byte[] outBuffer=null;
Byte[] inBuffer = new Byte[1024];
while (true)
{
//???????
outBufferStr = Console.ReadLine();
//outBuffer = Encoding.ASCII.GetBytes(outBufferStr);
outBuffer = Encoding.Default.GetBytes(outBufferStr + '