Results 1 to 22 of 22

Thread: Chat program

  1. #1

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407

    Red face Chat program

    Does anyone know how i can use winsock to connect to a remote computer on a network and connecting to a computer with the remotehost as \\computername\? also, does anyone know the port for a network? i want to connect to make a chat program.

  2. #2
    Hyperactive Member zer0_flaw's Avatar
    Join Date
    Apr 2001
    Posts
    448
    Does anyone know how i can use winsock to connect to a remote computer on a network?
    Code:
    Form_Load()
        'on server side
        Winsock1.LocalPort = 1000
        Winsock1.Listen
    End Sub
    Code:
    cmdConnect_Click()
        'on client side
        Winsock1.RemotePort = 1000
        Winsock1.RemoteIP = 123.123.123.123
        Winsock1.Connect
    End Sub
    also, does anyone know the port for a network? i want to connect to make a chat program.
    There is no select port for a network. You can use any you'd like... this will work because you're making a client/server type chat program.

  3. #3

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    I dont know if that will work the way i want it to...see..i have a input box that asks for the computer hostname (e.g. \\hostname\). I was wondering if i could connect to the remote computer using something like \\hostname\. Or do i have to stick with the IP?

  4. #4
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    the winsock control supports bot methods

    VB Code:
    1. Winsock1.RemoteHost 'Remote Host unc Name
    2. Winsock1.RemoteHostIP 'Remote Host IP
    3. Winsock1.RemotePort 'Remote Port

    You only need to supply either the IP or the name

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Code:
    Dim myInputString As String
    myInputString = Input("Please enter the remote computer name")
    myInputString = Replace(myInputString, "\", "")
    Winsock1.RemoteHost = myInputString
    Winsock1.Connect
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  6. #6
    Lively Member
    Join Date
    Nov 2000
    Location
    London UK
    Posts
    89
    Has anybody ever encountered that when server instance receives a connectionrequest RemoteHost is not actually the correct name of the client pc on the network?

    Why is that?

  7. #7
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Thats quite implausible.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  8. #8

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    I have a question...i was making the network chat i was talking about and i made it so you choose in the beginning if you are the Host or the Client. and then if you click client it will bring up the screen to type in the hostname of the host. (e.g. \\hostname\ like i said before) and when i hit connect, (i used the code up there for the client) it starts to load AOL (cause i use AOL ). The winsock wants me to dial into the internet when i want to use the network. How can i fix this?

  9. #9
    Hyperactive Member zer0_flaw's Avatar
    Join Date
    Apr 2001
    Posts
    448
    Wow, AOL is gay... my first suggestion would be to lose it. Secondly, turn of AOL's random dial option. This way it will not start unless you tell it to. You could also see if your program recognizes that you have a internet connection already established.

  10. #10

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    No, you see, i dont want to use a Internet Connection. I want to use my network. Which means, i dont need a dial-up connection for my network. So, AOL should not load at all.

  11. #11
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    I know how to fix it. Go to Internet Explorer, go to Tools-> Internet Options... Click on the Connections tab and find the Dial-Up settings. Choose Never Dial A Connection. Now click ok and it shouldn't try to dial up anymore.

    PS... If you are advanced enough to use a network, why the hell are you still using AOL? Why not get a real ISP? AOL is gay.
    <removed by admin>

  12. #12

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    is that it? i thought i had to change something in the code to make it not access a internet connection.

  13. #13
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    No... the reason is because Windows monitors all network activity, and if you have it dial a connection when you try to make a network connection, then it will open AOL because AOL modifies Windows to point to it, instead of the default Dial-Up networking manager.
    <removed by admin>

  14. #14
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    dont forget if you are using a network and you want to connect via the host name it will only work if there is a DNS server on your local network that will allow the hostnames to be resolved. The fact that it trying to dial up to the internet indicates that in your TCP/IP connections that the DNS servers are set to internet address.

  15. #15

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    ok well i dont have a server yet..so...how can i do it without using hostnames? my network ip? and i use IPX for games (duh) and NetBEUI for my network(works much faster) i also have TCP/IP on my network card..so yeah i have almost every protocol on my network. So, how would i connect?

  16. #16
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    well you have to options 1 use the IP address to connect to the remote system. 2 you could search the web for a free ware or shareware dns server product.

    I think the easiest way would be to go with the IP addys. However you could add a central DB that when each chat program starts it logs the user computer name and IP address. Then when someone wants to chat they just select an online user (sound familiar) and you app can do the rest based on info from the database

  17. #17

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    where would i find the IPs? If it is winipcfg, where would it be in winipcfg?

  18. #18
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    If you open WinIPcfg, it should just show it. You might have to change the adapter to the network card that is interfaced with your network.
    <removed by admin>

  19. #19
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Here is a screenshot of winipcfg with the ip address circled.
    <removed by admin>

  20. #20

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    yes i know where the IP Address is but, that is for your PPP Adapter which is what your ISP gave you. I want the network ip, which i think i have.

  21. #21

    Thread Starter
    Frenzied Member SomethinCool's Avatar
    Join Date
    Jan 2001
    Location
    Malvern, PA
    Posts
    1,407
    Also, when i type in Slow rider or \\Slow rider\ (thats the computer host name of the laptop, it's a 133Mhz, thats why i call it slow rider), it still gives me a address is not availble from local machine error. what does this mean?

  22. #22
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    You cant have a space in a hostname.
    The identification for windows networking can though.

    If you go into :
    Control Panel > Network > TCP/IP Properties for your Ethernet Adapter> DNS > Hostname

    And give it a proper hostname
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

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