Interviews2 answers
how to create socket programming in simple way to c# plz expalin ?
2 Answers
public static string ReverseString(string inputString)
{
char[] inputCharArray = inputString.ToCharArray();
char[] reverseCharArray = new char[inputCharArray.Length];
inputCharArray.CopyTo(reverseCharArray, 0);
Array.Reverse(reverseCharArray);
for(int i= 0;i< inputCharArray.Length;i )
{
if(!char.IsLetterOrDigit(reverseCharArray[i]))
{
reverseCharArray[i] = inputCharArray[i];
}
}
return new string(reverseCharArray);
}
Ibrahim RagabPosted Sep 2, 2017, 12:42 PM EDT
1.Socket program is otherwise called as Client- Server program.Namespace like System.net and System.Net.Sockets are required to develop socket programs.
We need two programs for communicating a socket application in C#. A Server Socket Program ( Server ) and a Client Socket Program ( Client ).
2. When working with sockets you can use either the TCP/IP (Transmission Control Protocol/Internet protocol) or UDP/IP (User Datagram Protocol/Internet protocol) communication mechanisms. In order to exchange data between two or more processes over a network, you can take advantage of the TCP and UDP transport protocols. While the TCP (Transmission Control Protocol) is a secure and reliable connection oriented protocol, the UDP (User Datagram Protocol) is a relatively less secure or reliable, fast, and connectionless protocol.
3. To establish the connection between server and client,Server address and port number are required.
PaulPosted Jun 19, 2016, 11:50 PM EDT
