Solved

Problem with winsock client/server URGENT! 500pts

Posted on 2006-06-10
13
236 Views
Last Modified: 2010-04-05
Hi guys

K heres the problem i created a program that uses a server[as server] and clients to connect to it...

setup:

[PC1][PC2][ PC3][Server]
  |       |        |       |
   \      |        |      /
     \    |        |    /
       \  |        |  /
[ADSL Modem ROUTER]
               |
          Internet

K i use port 2000 as my port for the programs server/client, on my Computer everything works fine, its when i take it to clients that i cant seem to get the clients to connect to the server or visa versa (like the diagram above)

The Server client is run on the server
            *PROBLEM*
      PC1-3 connects to server

I have let port 2000 open TCP/UDP on all the machines server and client, but it still wont connect...
When windows firewall pops up and asks, unblock i click unblock...

Q: Is there something that im missing in order to connect these PC's together over IP

Im using D7 XPSP2, standard delphi sockets
0
Comment
Question by:Scay7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 500 total points
ID: 16876794
I'm sure you know all this stuff, but I'll post it just in case.
Check your ADSL configuration, you probably need to setup NAT (network address translation/pinholing)
eg, when i run a server behind my router, i would open up port 2000 on the modem, directing all incoming calls on port 2000 to my server's local ip address.

You may also need to allow port 2000 in your modem's firewall
You may also need to allow port 2000 in your computer's firewall

for "me" to talk to your server, I need your "internet ip" , not your local network ip, or your router's ip, but the ip address assigned to your modem when it connects to the internet
go to http://whatismyip.com/ to see what that might be
this is the address you need to tell your clients to try to connect to.

for testing, disable all firewalls, (pcs and modem) and see if you can connect. if you can, turn them on 1 by 1 to see where the block is.

Another problem you can get is if both you and the client are behind firewalls, but this should not be a problem for a simple "connect" as in your case.
I'll have a think and post more once I get some caffeine
0
 
LVL 5

Author Comment

by:Scay7
ID: 16876803
K same problem :

PC1 = Server;
PC2 = Client;

K now there is no modem acting as router, just a plain HUB connecting all the pcs together and the modem connected to that HUB giving all the pc's internet

Im not connecting to the SERVER through the internet... just PC1 trying to get to PC2 both firewalls OFF and its still wont connect...

Scay7
0
 
LVL 5

Author Comment

by:Scay7
ID: 16876806
Oh also forgot to mention

PORT on Client and SERVER = same
Client connects to SERVERs  TCP IP

eg : Client = 10.10.10.100
      Server= 10.10.10.1

Subnet masks = ALL 255.255.255.0
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16876895
so the client ping the server successfully?
0
 
LVL 5

Author Comment

by:Scay7
ID: 16876912
ye they can ping each other...
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16876920
try telnet from the client to the server
start- run- cmd.exe

telnet 10.10.10.1 2000
type test commands
(ctrl-c to quit)
does that work? if so, check your client code, and make sure it is not hardcoded to "localhost' ;-)
0
 
LVL 5

Author Comment

by:Scay7
ID: 16876964
ClientSocket1.Address := edit8.Text; //server ip
 ClientSocket1.Port := 2000; //port
 clientsocket1.Open; //open

Telnet works
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16877109
if the client can't connect remotely, you must be getting an error. what error do you get on the client? (10054, 10061, etc)
do you have a short 'connect timeout' set?
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16877118
some other possibilities.
no tcp installed on the client pc :-)
anti-virus (some are quite promiscuous)
0
 
LVL 5

Author Comment

by:Scay7
ID: 16877809
- K i got the error code from them : 10061
- No timeout just doof cant connect
- TCP installed and working
- Plain antivirus without firewall, using windows firewall...
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 16879377
if telnet is working from the client, and you do not have a firewall/av active that is specifically blocking your application, then it must be the code in the project
i think I have it :-)

Set ClientSocket1.Host
not ClientSocket1.Address
0
 
LVL 5

Author Comment

by:Scay7
ID: 16973309
"eg, when i run a server behind my router, i would open up port 2000 on the modem, directing all incoming calls on port 2000 to my server's local ip address."

I think this is the problem... how do i set a billion ADSL modem to

send data from pc's to server
and
send data from server to pc's

I have a basic idea, about NAT...

Sorry for the time gap, had other pressing matters aswell :P

Peace Scay7
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17068778
I really mean it :-) have you tried setting the "host" property instead of the "address" property

aside from that.
you only need to set up the adsl NAT on the server's ADSL modem, not the clients
adsl modem's and routers allow most "outgoing" connections unless they have set up a specific rule denying it
it is only the server that needs the pinhole, so I don't think this is yuor problem.
Let me know if the "host" porperty fixes it or not


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question