Yet again-> Socket Programming .Net
Posted 17 April 2011 - 03:49 PM
I have a small Client-Server application. First the Server Binds to IPAddress.Any and a Port say 8221 and then Listens and waits.
Then the Client connects to the Server and they both communicate.
Communication is simple:
Server has 3 buttons. B1 to Bind and Listen and when the client connects B2 sends a ''Hi'' to the client and B3 sends a "Bye" :-)
When I run the client and server on 2 separate machines (ofcourse connected to the same wireless network) the communication takes place good.
Now I have bought a Domain Name say xyz.com with an own Dedicated IPAddress and is hosted on a NameServer (I am using ixwebhosting).
So I have a Server running on the above domain with is own IP. When I open my page www.xyz.com/server.aspx I see the 3 buttons. I click B1 and my server binds to the a IP (IPAddress.Any, Port:8221) and waits. Now I have this client but when I try to connect to the Server's IP with port 8221 I get an SocketException ( A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Server's IP:8221 )
I think I am missing something. I read the post about Port Forwarding as well but I am clear about how do I use it in my case.
Any help would be appreciated.
Thank you in advance.
Posted 17 April 2011 - 04:22 PM
Posted 17 April 2011 - 05:14 PM
Thank you for your prompt response.
Well I checked with the hosting provider's tech support regarding the unblocking of the port but I got the following response :
" We cannot unblock the port because this application is your own and there is no any installation guide and official requirements of the server which we could provide to our administrators. We couldn't unblock port for such application due to Shared Hosting Environment. "
Now, I have no idea as to how I can check whether my Client-Server communication works on the Internet or not!
Any suggestions? I need to do this.
Thanx in advance.
Posted 17 April 2011 - 05:48 PM
Posted 17 April 2011 - 06:08 PM
Yes I am hosting on a Web Hosting Service(WHS).
Now I have 2 questions:
Q1) If I choose to continue with WHS I should make my server socket.Bind() to IPAddress.Any, Port: 80 and my client to socket.Connect() to Server's IP, Port: 80 to make my communication work?
Q2) If I opt for a VPS Hosting then do I have to make any other modifications other than requesting for opening the port 8221 ?
I am totally new in this. In fact this is my 1st application that I am developing with Sockets so please bear with me if I sound silly!
Thanx in advance.
Posted 17 April 2011 - 06:38 PM
Unlike shared hosting, a VPS provides you with your own virtual system such as Linux or Windows and with better hardware. This allows you to do whatever you want. It's like having a second computer, although its resources are shared with other servers on the box. This sounds like the package you want. I would also suggest you purchase one that comes with a dedicated IP.
Posted 18 April 2011 - 07:44 PM
Thanks a lot for your guidance.
Well, I am working with asp.net.
I will go for VPS now and try out.
If I get any problems further I will get back here... ;)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users