12 Replies - 514 Views - Last Post: 27 June 2011 - 02:41 PM Rate Topic: -----

#1 Andrew74  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 20
  • Joined: 26-June 11

Can some explain this please?

Posted 27 June 2011 - 12:06 PM

I found this http://www.vb6.us/tu...ontrol-tutorial simple client server chat program that uses winsock and I can't seem to figure something out. What I don't understand is what is the number in the txtHost "127.0.0.1". Is it the ip address of the computer that the server is on?

I went to go test this theory of it's the ip address and got an error trying to run the client, said something like "winsock registries is missing..... " or something like that, any idea what would cause that?

Is This A Good Question/Topic? 0
  • +

Replies To: Can some explain this please?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9296
  • View blog
  • Posts: 34,832
  • Joined: 12-June 08

Re: Can some explain this please?

Posted 27 June 2011 - 12:21 PM

127.0.0.1 is your local home address. It loops back to you.


http://en.wikipedia.org/wiki/127.0.0.1

This post has been edited by modi123_1: 27 June 2011 - 12:22 PM

Was This Post Helpful? 0
  • +
  • -

#3 Andrew74  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 20
  • Joined: 26-June 11

Re: Can some explain this please?

Posted 27 June 2011 - 12:23 PM

View Postmodi123_1, on 27 June 2011 - 12:21 PM, said:

127.0.0.1 is your local home address. It loops back to you.


So when I use the client side of the program instead of using 127.0.0.1 I would use the server ip address?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9296
  • View blog
  • Posts: 34,832
  • Joined: 12-June 08

Re: Can some explain this please?

Posted 27 June 2011 - 12:28 PM

If 127.0.0.1 loops back to the machine you are currently on then yes if you want a client to reach a specific server then *not* using the localhost IP would be best.
Was This Post Helpful? 0
  • +
  • -

#5 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Can some explain this please?

Posted 27 June 2011 - 01:51 PM

Yes, it is the IP address of the local computer, as the tutorial says. What you are doing is putting two forms together, both on the same machine, and they are using TCP/IP to talk to each other through a Winsock connection.

You'll need to explain the exact error if we are to help you. So, copy it down and post it. I've tried this tutorial and it works fine.
Was This Post Helpful? 0
  • +
  • -

#6 Andrew74  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 20
  • Joined: 26-June 11

Re: Can some explain this please?

Posted 27 June 2011 - 01:57 PM

View Postmodi123_1, on 27 June 2011 - 12:28 PM, said:

If 127.0.0.1 loops back to the machine you are currently on then yes if you want a client to reach a specific server then *not* using the localhost IP would be best.


When I use 127.0.0.1 and I have the client and the server on the same computer I can connect no problem but when I use a different computer and a different network and use the servers ip address I can't connect. Any idea why this happens?
Was This Post Helpful? 0
  • +
  • -

#7 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9296
  • View blog
  • Posts: 34,832
  • Joined: 12-June 08

Re: Can some explain this please?

Posted 27 June 2011 - 02:01 PM

There could be many problems. You need to specify a port, you have the address wrong, the server firewall is blocking it, the client fire wall is blocking outside communication, you don't have connection strings right, and so on. An error, some code, and more detail would be helpful.

This post has been edited by modi123_1: 27 June 2011 - 02:01 PM

Was This Post Helpful? 0
  • +
  • -

#8 Andrew74  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 20
  • Joined: 26-June 11

Re: Can some explain this please?

Posted 27 June 2011 - 02:11 PM

View Postmodi123_1, on 27 June 2011 - 02:01 PM, said:

There could be many problems. You need to specify a port, you have the address wrong, the server firewall is blocking it, the client fire wall is blocking outside communication, you don't have connection strings right, and so on. An error, some code, and more detail would be helpful.


I'm testing with my two labtops one with vista and the other with W7. I fixed the register error on W7 so now I can launch the client program.

In the client host text box I put the servers ip address and the port # Then press connect and don't get a response.

What could cause not getting a response?

Can winsock even talk with another computer on a different network?

View PostBobRodes, on 27 June 2011 - 01:51 PM, said:

Yes, it is the IP address of the local computer, as the tutorial says. What you are doing is putting two forms together, both on the same machine, and they are using TCP/IP to talk to each other through a Winsock connection.

You'll need to explain the exact error if we are to help you. So, copy it down and post it. I've tried this tutorial and it works fine.


I don't want to use a local computer... Any idea how to make this program work with non-local computers?

This post has been edited by Andrew74: 27 June 2011 - 02:09 PM

Was This Post Helpful? 0
  • +
  • -

#9 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9296
  • View blog
  • Posts: 34,832
  • Joined: 12-June 08

Re: Can some explain this please?

Posted 27 June 2011 - 02:12 PM

Like I said a million things could be doing that.

What do your variables look like when you Debugging through them? Any exceptions in the try/catches? Any returned 'null' objects?
Was This Post Helpful? 0
  • +
  • -

#10 Andrew74  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 20
  • Joined: 26-June 11

Re: Can some explain this please?

Posted 27 June 2011 - 02:23 PM

View Postmodi123_1, on 27 June 2011 - 02:12 PM, said:

Like I said a million things could be doing that.

What do your variables look like when you Debugging through them? Any exceptions in the try/catches? Any returned 'null' objects?


Everything is working fine.

Is winsock the correct thing to using for a sever side program that can be accessed from any computer?
Was This Post Helpful? 0
  • +
  • -

#11 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9296
  • View blog
  • Posts: 34,832
  • Joined: 12-June 08

Re: Can some explain this please?

Posted 27 June 2011 - 02:31 PM

Well clearly it's not working, right?

Yes winsock is one way of doing this.
Was This Post Helpful? 0
  • +
  • -

#12 Andrew74  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 20
  • Joined: 26-June 11

Re: Can some explain this please?

Posted 27 June 2011 - 02:39 PM

View Postmodi123_1, on 27 June 2011 - 02:31 PM, said:

Well clearly it's not working, right?

Yes winsock is one way of doing this.


What are the other ways?

Is the winsock the easiest of them all?
Was This Post Helpful? 0
  • +
  • -

#13 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9296
  • View blog
  • Posts: 34,832
  • Joined: 12-June 08

Re: Can some explain this please?

Posted 27 June 2011 - 02:41 PM

It's all relative. Go forth and do some research! See what works best for you in your situation. in theory you be able to run it no problem, but obviously that's not happening.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1