Click here to Skip to main content
15,898,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am working on an application to send messages over internet via sockets but i am not able to figure out how to send info. via internet to other pc. I searched many articles but every article says about "LAN". can somebody provide me a good link or a piece of code snipet.

Thanks in advance
Posted
Updated 22-Feb-14 17:15pm
v4
Comments
Sampath Lokuge 10-Nov-13 3:22am    
What is your app ? is that Asp.net web or windows ?
agent_kruger 11-Nov-13 5:44am    
it is windows form application
Sampath Lokuge 11-Nov-13 5:47am    
Did you try the below mentioned solution ?
Richard MacCutchan 19-Feb-14 10:13am    
You can only send to systems that are listening for your messages. So you need a server application at the remote end, that is not blocked by a firewall.
agent_kruger 19-Feb-14 11:55am    
sir, i have disable the firewall and i am using listener too but it is only listening to pc on LAN.

1 solution

Try this:

serverSocket.Bind(new IPEndPoint(IPAddress.Any), 8999));


For more info : Socket Communication in C#
 
Share this answer
 
Comments
agent_kruger 19-Feb-14 5:14am    
sir, i tried "my public ip" instead of this "IPAddress.Any" and it shows the same error as in parsing the public ip.
Sampath Lokuge 19-Feb-14 5:50am    
Please remove this (i.e. IP address) from your comment.Its no need here.
agent_kruger 19-Feb-14 6:08am    
sir, i just did it for example but i removed it.
agent_kruger 16-May-14 9:34am    
sir, does this thing work over INTERNET not INTRANET?

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