Solved

Problem with winsock client/server URGENT! 500pts

Posted on 2006-06-10
13
231 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 94
PDF library for Delphi 2 107
Delphi Mdi application Child forms get behind control 7 162
Delphi...Split view - idea? 1 42
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now