2 Ocak 2016 Cumartesi

TCP İstemci Soketi

Socket Sınıfı
Constructor metodu
Şöyle yaparız.
string ServeripAddress = "192.168.1.200";
int PortNo = 8000;
Socket clientSocket = 
new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Connect metodu
Şöyle yaparız.
string ServeripAddress = "192.168.1.200";
int PortNo = 8000;
// Connect the socket to the remote endpoint.
clientSocket.Connect(ServeripAddress, PortNo);

if (clientSocket.Connected) {...}
Send metodu
Şöyle yaparız.
byte[] data = ...
clientSocket.Send(data, data.Length, 0);

Hiç yorum yok:

Yorum Gönder