Results 1 to 26 of 26

Thread: Vb6 Tcp/ip

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Vb6 Tcp/ip

    Hello everybody, I'm not a programmer but willing to learn something new. I would like to ask how does TCP/IP work. How do they eventually link to each other. Can anyone explain to me what is TCP/IP before i move on to my next question? THanks in advance.

  2. #2
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Vb6 Tcp/ip

    That's a very broad question. Books have been written on TCP/IP and to just answer your question in a few sentences wouldn't do it justice. You would have to learn about the OSI model, the TCP/IP model just to get the tip of the iceberg. Then you would need to go into each protocol that is part of the TCP/IP genre.

    Perhaps you should ask your next question or a more specific question?
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Re: Vb6 Tcp/ip

    Well, everything is see a network they will have a TCP/IP. For my understanding TCP/IP is an address for a transmission move or put it in a way that where data will transmit/received from that specific address. Am I wrong or right? I'm a little confuse though. Hence by determining a TCP/IP, other network computer may gain access to the program that you set the TCP/IP? Am I right or wrong? So the question is, how would a network computer(A) connects to the TCP/IP address which allowed the network computer(A) gain access controlling the particular software activities? Or maybe perhaps the software which i name it for example as computer server(M) would served all the data to all the network computer client? I would like a starting point to look to before I ask more of my doubts. Thank you drivenbywhat.

  4. #4
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Vb6 Tcp/ip

    OK. perhaps you could have tried the Google or WIKI ?
    (Just kidding . My Google is your Google )

    Take a look at these

    http://en.wikipedia.org/wiki/OSI_model
    http://en.wikipedia.org/wiki/IP_address
    http://www.novell.com/info/primer/prim05.html
    http://cisco.com/univercd/cc/td/doc/...c/introint.htm
    http://www.webopedia.com/quick_ref/OSI_Layers.asp




    And from your other thread about the Vb6. and VB.Net , I think your problem is how to connect to Internet using VB, right?
    If that so, you need to use some controls like WinSock or Inet control
    You could find plenty of examples in here for those. And perhaps you could ask what the real need is, so we could guide you.

    Cheer!

    IIF(Post.Rate > 0 , , )

  5. #5
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Vb6 Tcp/ip

    Trying to understand TCP/IP to do what you I think you need is not entirely necessary. TCP/IP lets PCs communicate with each other. As long as the program knows the IP address (ex: 192.168.0.1) of the program it's trying to communicate with, the port and is on the same network/subnet, then communication can begin.

    The best example to start with is an instant message program. The control you need is WINSOCK. If you search the forums for "winsock" & thread starter "pino", you will find an example on how to make an IM client. However, you said you are not a programmer? Before you delve into any "network programming", you will need to learn the basic programming statements and logic. Then you can tackle network programming.
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  6. #6

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Re: Vb6 Tcp/ip

    Well, I know some basic like case statement, if & else statement, ADODC database connecting to Microsoft Access, Boolean and for loop. Other than that I'm still learning which I dont know who I can learn from. Hope you guys dont mind my dummies. Hehe. Anyway, i've look at the winsock. I've read it and I dont know how to apply it. When I first downloaded it, I run the winsock.exe which gave me an error. So how am I going to applied to VB6 by running the winsock.exe? Doesnt winsock suppose to be something like dll file? For example of my comp sending output data to parallel port they need to have the connection of inpout32.dll file? Doesnt winsock application is similiar to that? Then I've downloaded a tutorial of Multi-User Chat server/client examples from the vbforums. I analyze the example. A lot of doubts I want to ask but dont know where to start. So to learn another new stuff, I would like to ask what is the function of a Module? where you see it at your right panel underneath the forms. Then they declare a lot of Mod. Then second question, From the form of Server instead of client, I compared that client need to type IP address while server you dont need to set an IP address, How can the client locate the server when server never set a specific IP address/where do I look at the specific address of the server?. Third question, does this example applied winsock? If yes, where is the winsock code/connection to winsock that makes it gain access to the internet?

    Code:
    .sckServer(0).Listen 'Opens the winsock control.

    Can anyone explain what is IsNumeric? Is it you can only put a-z 0-9? if other characters, then errors shows ?

    Thank you guys, would appreciate everything that you guys will be teaching me right now.

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Re: Vb6 Tcp/ip

    Oh ya... this is the example from the vbforums that i forgot to upload. Thanks.
    Attached Files Attached Files

  8. #8
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Vb6 Tcp/ip

    1st question: a module is simply another place that you can put code in. Normally, instead of putting all the code inside the form, you could put it in a module. It's better organization but there is a lot more to modules than that very simple explanation. Again, if you search these forums, you will find quite a few discussions on just modules alone.

    2nd question: it is correct, the client is the only one that needs to know the ip address that it needs to connect to. If you're asking why the server doesn't need to know the client's ip, then the internet would be very hard to work with. For example, when you go to www.vbforums.com, it actually has an ip address instead of that name. How is it that you are able to connect to it without it knowing your ip address? Like a program in vb, it uses a "port". The port "listens" for incoming packets. So when the client is sending an IM to the server, the server is listening for that IM at a specific port. The ip address is found through the miracle of the internet and its routers that make sure your IM gets to that ip address. It's once that it gets to the ip address that really matters. If no program is listening on the port needed, then your computer will discard the "packet" that arrived.

    3rd question: I don't know which example you downloaded for chat app but it probably does use winsock. The code for it is under the name of the control. In this case it looks like it is named sckServer. The normall events that are used for that control are connect, dataArrival, close, and connectionRequest. What each does you can guess just by reading it's name.

    To add winsock to a new program, to go PROJECT > COMPONENTS > check MICROSOFT WINSOCK CONTROLS
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  9. #9
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Vb6 Tcp/ip

    Can anyone explain what is IsNumeric? Is it you can only put a-z 0-9? if other characters, then errors shows ?

    Thank you guys, would appreciate everything that you guys will be teaching me right now.
    IsNumeric - http://www.vbforums.com/showpost.php...9&postcount=14

  10. #10

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Re: Vb6 Tcp/ip

    Hmm, So when you specific a TCP/IP , how do we listen to the port of the client? Will there be a crash on both same IP? like client A(192.168.1.2) and client B(192.168.1.2). So the server(192.168.1.1) will listen to which port? I m still doing research though. Thanks Guys.

  11. #11
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Vb6 Tcp/ip

    From what I could make out of your post (barely), you are asking how you would listen to the client's port? Easy, you don't! I said only the server needs to listen to the port because it is the one "hosting" the connection. That's why it needs to listen on a specific port. Once the client sends a "packet" on a specific port to the server, the server gets that packet by listening on that port.

    Once that packet has been successfully delivered, a "connection" has been established between the client & the server. Again, behind the scenes, is other stuff going on. You don't need to know the port of the client because it is done automatically for you. A free random port number will be "picked/chosen" on the client. That info will be sent along when the client tries to talk to the server. The server will then know the port to send a reply to the client. You don't have to worry about it. The connection will remain until either the server or the client decide to end the connection.

    Think of it like a telephone. When you call someone, you are "calling the server" by their telephone number (ip). At no point in time does the telephone you're calling need to know your phone number. Through the magic of the telephone, a "circuit" is made between both lines and automatically both phones know how to reach each other without any more info from you other than the phone number you dialed (" the server"). The connection (the telephone conversation) will continue until you or the person you called (server), hangs up.

    I'm not sure what you're saying in regards to the same ip. Technically, there shouldn't be any duplicate ip on your network. Each ip should be unique or your computers will not be able to get on the network. Are you confusing ip with port? An ip looks like this: 192.168.0.1. A port looks likes this: 2351. Big difference. A port number goes from 0-65,000 or something close to that.

    The best way to learn this stuff is not by reading it. It's by doing it. Like I said in a previous post, get started on making an IM program. Do this by downloading the example from http://www.vbforums.com/showthread.php?t=297308. Read only the first post, don't worry about the other ones. You should get a better understanding of winsock. Then post any questions you still may have.
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  12. #12

  13. #13

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Re: Vb6 Tcp/ip

    Alright, I understand a little more already. Winsocks help you to connect to each other computer and transfer data among it. The server will open port to all other clients. Clients just identifies the server's port and server will listen to the client if the port is right? Correct? Well then, when server listens to the port, not only then, client have to identifies the server's ip address too right? So... the only thing i dont understand is, will the other client will make the server crash due to maybe perhaps, same ip address? For example, Client A(192.168.1.2) and Client B(192.168.1.2) connects to Server(192.168.1.1). If this is possible, then server will be sending the same data to client who has 192.168.1.2 IP right? or receiving individual? Or maybe Server identifies the machine name hence IP could be anything right? Hence, i would like to know, how does those msn,mirc,icq,yahoo and etc. works? I can see the logic is simple, but still i want to know how to operates. Oh, 1 more thing, port... so with the port like 4000 for example, is used on software A and software B. Will they be transfer same data? or individual? If individual, how they work? Or port is just like a gate pass for you to go through? Hope you guys dont mind my dummy. Thanks all.
    Last edited by sephirothzero85; Oct 16th, 2007 at 10:27 PM.

  14. #14
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Vb6 Tcp/ip

    Don't take offense but I wished your English was better and you explained yourself better...

    The client needs to know both the ip address & port number of the server for a connection to occur. I still don't understand what you are saying about the same ip address. Are you trying to run two clients from the same pc and that's why you keep saying the same ip? If so, the server will receive packets separately for those clients but in order to know which client sent you the data you have to have multiple winsock controls. Again, if you want to see if it will crash, TRY IT.

    I still don't know why you keep asking how MSN and those work. If you did what I told you and downloaded the example, you would know how it works because you would have tried it.

    For your question about port 4000, software a & b does not tell me which one is the server so I can't answer your question. Anyways, a pc can only LISTEN to just 1 port #. You can't have different servers listening to the same port, it will crash.

  15. #15

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Re: Vb6 Tcp/ip

    LoL, sorry, my english not that good though. I done the examples you showed me. Didnt expect it was simple.

    Ok, you almost understand what I've said. I m not trying to run two clients from the same pc but instead running two clients from different computers but using the same IP. Will it crash the server or client?

    About the Port, let's say, for example, MSN Messenger running at Port 6667 and Yahoo Messenger running at Port 6667 too! So, you should know what I trying to ask? If this 2 software runs at the same port so will it be MSN client can enter Yahoo server and Yahoo client can enter MSN Server too? Wouldnt it crash because it's 2 different thing?

    Thanks with your patient though =)

  16. #16
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Vb6 Tcp/ip

    Well buddy, I think you have to learn the basics first. Did you look at those links I gave, at least a quick glance?
    I mean as I said (to search) , in a research, you have to research. Your question have broad spectrum. TCP/IP. what is it? Why TCIP/IP?why not somthing else.
    This I learned (not 100%), in 4 years , in my degree. It is such a broad area.
    To understand how IP adress works, you need to identify what IP adress is.

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

    We can ofcourse, help you , but not teaching you whole thing about TCP/IP, I mean its a big area, thats why.
    And if you can tell us why you need to learn this, Any application you are making, we could guide you for that.
    What controls to use, how to use them, etc ...

    If you could , please tell us what your real need is.
    Are you trying to connect two computers in a network and do something?
    Are you trying to create a Client / Server Application?
    ......

    IIF(Post.Rate > 0 , , )

  17. #17

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Re: Vb6 Tcp/ip

    Alright, I will tell you why I need to know about TCP/IP and purpose of learning it. As you can see, I'm a Electrical & Electronic Engineering Student in the final year and of course with a project in that duration.

    This topic I set here is aboout TCP/IP and I dont tend to mix my project with this thread here. Firstly, I would want to know how a TCP/IP goes about. As you can see my project is about anything connects from client to server. For example, Handphones connect to server which provide home surveillance. Or maybe Handphones connect to server to control a machine or system or gadgets or could be anything. How to off an alarm when you are not around the server but server sent a notification instead to say that your alarm has been triggered and could be stop by just a msg from your handphone? So the whole concept of learning the TCP/IP is to know how the communication works.

    So i need to do a little thing part by part. When I get the concept, I am able to think how things would operate and need guidance from the professional programmers. Though is a broad area and programming is not my expertise, hence would really appreciate all the help around the globe. =) Really hope you guys dont mind what I'm trying to find out. Appreciate really much.

  18. #18
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Vb6 Tcp/ip

    TCP/IP is how the internet works on it's most common level.

    All you need and more is here. He spent 10 years studying TCP/IP and there is nothing he missed.

  19. #19
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Vb6 Tcp/ip

    Ok, your 1st question. Are both the pc's with the same ip address in your home? Or are you asking how the server would know the difference between different computers from different places in the world if they had the same ip address? Well, as I said earlier, you cannot have the same ip address. Every pc in the world has a unique address. No one else can have it. If you have the same ip in the same office, those computers will not be able to work on the network period. Forget about even connecting them to your server because they won't connect to anything period. The same goes for computers in other places.

    2nd question. Your msn & yahoo shouldn't be listening to the same port 6667. It just can't be possible. Only 1 program can listen to 1 port. You can't have different programs listening on the same port because either both programs won't work or they won't work correctly. MSN is port 1863 & yahoo is 5050.
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  20. #20
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Vb6 Tcp/ip

    sevenhalo, I read that site when I was taking networking classes last year. It helped a lot. Although he may not have missed things, he sure had errors & typos, lol.
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  21. #21
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Vb6 Tcp/ip

    Ok, grammatical errors is one thing - but the content is dead on.

  22. #22
    Fanatic Member drivenbywhat's Avatar
    Join Date
    Jan 2007
    Location
    VA - USA
    Posts
    866

    Re: Vb6 Tcp/ip

    It wasn't just grammatical errors. There were also technical ones. They lowered the content value when your scratching your head asking why is it 82 hosts instead of 86? If you read the ERRATA section, you'll see the mistakes he's made. But like I said, his book is good though and lets not clog this thread with irrelevant posts.
    [vb5 & starting to move to vb2008] I appreciate the help I get from everyone. Thank you.

  23. #23
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Vb6 Tcp/ip

    Ok, before you goto TCP/IP, perhaps better to learn what is below TCIP/IP.
    You must knwo (since you an Electronic Engineer) , that all we see in a computer is based on 1s and 0s. do you agree? in electronics , these 1s and 0s are taken as voltage levels (If I m not correct please forgive me )

    So even the data communication needs 1s and 0s. So how does the network send these data? Who does that. See , the network, is all together connected. there is no one to one connection in a LAN (BUS network topology). so it means these computer needs to know how to connect to each other.

    Thats why there have been a modal for data comunication. Each function is devided into 7 layers of function. The Open Systems Interconnection(OSI) layers. There are 7 layers: Physical , Daya Linik, Network , Transmission , Session , Presentation, Application

    so the basic, ground lavel layer is Physical Layer, which handles the physical connection.

    TCP/IP is actually a model which has 5 layers.
    http://en.wikipedia.org/wiki/TCP/IP_model

    So each layer would have some sort of information to be sent, each layer adds a header to the data packet ist sending. and the physical layer would send this to the destination. and in the destination each header is taken out, in each layer.

    So thats the basic communication stuff. Mind that this is not 100% of the subject. Its , say, about 0.01 % of it.

    So if you are not going to do the progrmming by your self, I think its not much not needed go into the deep ends . but its always good to know your stuff.
    Any way what you should go after (as I think) is Cleint server Architecture.

    http://en.wikipedia.org/wiki/Client-server

    To do the jop, you could modify the chat application and see how to detect stuff. Say the chat application sends data between Client and server. so what you should do is create a application that send definiete data. Define your data as signals. These signals could be some words.

    say "[HEADPHONE_ON]" = so when this is arrived at the client, the application progrma there knows what to do. like that. hope you got some idea.

    IIF(Post.Rate > 0 , , )

  24. #24
    Frenzied Member
    Join Date
    Jul 2007
    Posts
    1,306

    Re: Vb6 Tcp/ip

    Oh one thing again. To control devices, you would need to send data to you circuits right? say you have a general purpopse remote controler (RF signals.) which is conencted to a computer throught te serial port(COM port). So to comunicate between the circuit and the computer you need to send signals to the COM port. To do that you can use MS Comm control (not common controls.)
    Mind that these physical Ports and TCI/IP ports are different.
    IIF(Post.Rate > 0 , , )

  25. #25
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Vb6 Tcp/ip

    But like I said, his book is good though and lets not clog this thread with irrelevant posts.
    Irrelevant posts my ass - don't get full on yourself now. I see you're a little newer, but one peice of advice I can give you here; is if people ask very abstract questions - give them a full resource. Yes, it might be a bit dated, but it has plenty to offer.

    Oh, and as a side note - I appreciate your attempt to clarify me (checks and balances are always good), but if you're gonna try and take a jab; don't be cheap about it. By post 23, it's already clogged.

  26. #26

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    58

    Re: Vb6 Tcp/ip

    Alright, I'll do more research now since i have most of the sources. I wont resolve this thread yet until I fully understand how TCP/IP goes. Give me some time to read up and gather my doubts. THANKS GUYS! Sorry if my english aren't that good and offended the professional programmers. LoL. Sorry and thanks a lot. Will feedback right after my research. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width