Click here to Skip to main content
15,880,427 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi everyone,

I'm install Windows Server 2012 with VmWare. Then, change ip with static IP. Now, I wanna use it for Socket Programming. What I don't know, what I need to write Socket? For connect with localhost, I write that code;(Server Side)
C#
_serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_serverSocket.Bind(new IPEndPoint(IPAddress.Any, _PORT));


And Client Connection side;
C#
_clientSocket.Connect(IPAddress.Loopback, _PORT);


But now, I wanna use my server. I have an IP address, but I don't know, how can use that IP. When I write my Server IP address instead of "IPAddress.Any", my program throw an exception.

Please help me, What I need to do for Data Send/Receive between two computer.

P.S. : Computers are clients, every client send data to my Server. My server transmit to other client.
Posted
Comments
[no name] 30-Jun-15 18:04pm    
Don't you think that knowing the exception is kind of important to your problem? And maybe posting the bit of code that throws the mystery exception?

1 solution

A "server" is a logical term and any computer can become a "server", it depends on the software you run (independent from the operating system type).

See my article on the subject : WCF Killer[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900