Results 1 to 12 of 12

Thread: Client not Connecting...

  1. #1

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Client not Connecting...

    Hi, I have a question reguarding winsock connection.

    In some cases, when certain people try to connect to my server they never reach or make a connection request on my side yet on their side it says that it didn't find the server.

    I use www.no-ip.com so they always have my current IP address, also i've tried editing my no-ip.com account so that they connect to other reasonable IPs that I currently have... and still they are not able to connect to me.
    Is there a reason why they cannot reach/find me and can this be fixed?

    Thanx
    ؊Ϯϊ

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

    Re: Client not Connecting...

    Quote Originally Posted by Osiris
    Hi, I have a question reguarding winsock connection.

    In some cases, when certain people try to connect to my server they never reach or make a connection request on my side yet on their side it says that it didn't find the server.

    I use www.no-ip.com so they always have my current IP address, also i've tried editing my no-ip.com account so that they connect to other reasonable IPs that I currently have... and still they are not able to connect to me.
    Is there a reason why they cannot reach/find me and can this be fixed?

    Thanx
    Wierd, i think we will need to know more specifics, could i see the server listening code and the client connection code?

    also your hardware set up are you behind a router?

  3. #3

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: Client not Connecting...

    Quote Originally Posted by Pino
    Wierd, i think we will need to know more specifics, could i see the server listening code and the client connection code?
    Well, there is really no client code, the client is basically a web browser from another computer and I am listening through port 80. When ever I connect to my no-ip.com hostname, I am able to access my server, so the server code seems to work fine...

    Code:
    Private Sub wsock_ConnectionRequest(ByVal requestID As Long)
        wsock.Close
        wsock.Accept requestID
        
        If wsock.State = sckConnected Then
            Logg "Connection request from " & wsock.RemoteHostIP
        End If
    End Sub
    I am not sure which section of the server code you might want to see?

    also your hardware set up are you behind a router?
    No, I don't have a router, but I use DSL and a firewall, but since I'm listening through port 80 I thought I might not have any problems...
    ؊Ϯϊ

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

    Re: Client not Connecting...

    Quote Originally Posted by Osiris
    Well, there is really no client code, the client is basically a web browser from another computer and I am listening through port 80. When ever I connect to my no-ip.com hostname, I am able to access my server, so the server code seems to work fine...

    Code:
    Private Sub wsock_ConnectionRequest(ByVal requestID As Long)
        wsock.Close
        wsock.Accept requestID
        
        If wsock.State = sckConnected Then
            Logg "Connection request from " & wsock.RemoteHostIP
        End If
    End Sub
    I am not sure which section of the server code you might want to see?



    No, I don't have a router, but I use DSL and a firewall, but since I'm listening through port 80 I thought I might not have any problems...
    Whats the problem then? If you can still connesct? (sorry if you've allready mentioned it)

    The code looks fine but you do relise that will noly work for one client? You need to set up mulitple connections if you wnat more than one client to connect.

    Pino

  5. #5

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: Client not Connecting...

    Quote Originally Posted by Pino
    Whats the problem then? If you can still connesct? (sorry if you've allready mentioned it)

    The code looks fine but you do relise that will noly work for one client? You need to set up mulitple connections if you wnat more than one client to connect.

    Pino
    Yes I know, it will only work for one client now... but I am just testing it with one client only.

    Well, when I try to connect from my computer to my computer, the server detects that I am connecting to it.
    Also when I connect from a computer in the same network as the server, the server detects that I am connecting.
    But when I ask a friend which lives far away, lets say, canada... (im in the u.s.), they never could connect and my server never displays their connection meaning they never reached it. (I am listening through port 80 by the way....)
    ؊Ϯϊ

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

    Re: Client not Connecting...

    Quote Originally Posted by Osiris
    Yes I know, it will only work for one client now... but I am just testing it with one client only.

    Well, when I try to connect from my computer to my computer, the server detects that I am connecting to it.
    Also when I connect from a computer in the same network as the server, the server detects that I am connecting.
    But when I ask a friend which lives far away, lets say, canada... (im in the u.s.), they never could connect and my server never displays their connection meaning they never reached it. (I am listening through port 80 by the way....)
    Thats very wierd, whne you say network, how do your network acces the internet is it througha switch or router of some kind?

  7. #7

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: Client not Connecting...

    Quote Originally Posted by Pino
    Thats very wierd, whne you say network, how do your network acces the internet is it througha switch or router of some kind?
    Well, there are two places where I have tried this server, school and at home.

    At school, I log in on one computer and start the server, and on another computer I open a web browser and try to connect to the server (I would have updated my no-ip account before all this though) and it works perfect.
    Although I have never asked someone to access my server from outside my school's network.

    When at home (I only have one computer connected with DSL), I start the server and connect to it from the same computer it works. But when I ask a friend to connect to it, they never seem to to find the server and my server doesn't display that they have reached it either.

    What is weird though, is that if I make the server listen through a different port, lets say 1900... and on the other side someone else is trying to connect with an application using port 1900 as well, it is able to connect. I think I am only having trouble with people connecting to me through port 80.
    ؊Ϯϊ

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

    Re: Client not Connecting...

    Quote Originally Posted by Osiris
    Well, there are two places where I have tried this server, school and at home.

    At school, I log in on one computer and start the server, and on another computer I open a web browser and try to connect to the server (I would have updated my no-ip account before all this though) and it works perfect.
    Although I have never asked someone to access my server from outside my school's network.

    When at home (I only have one computer connected with DSL), I start the server and connect to it from the same computer it works. But when I ask a friend to connect to it, they never seem to to find the server and my server doesn't display that they have reached it either.

    What is weird though, is that if I make the server listen through a different port, lets say 1900... and on the other side someone else is trying to connect with an application using port 1900 as well, it is able to connect. I think I am only having trouble with people connecting to me through port 80.

    Yes i have a feeling what is going on but i'm not 100% could i see the app? source? i can test it out then.

  9. #9

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: Client not Connecting...

    Quote Originally Posted by Pino
    Yes i have a feeling what is going on but i'm not 100% could i see the app? source? i can test it out then.
    Logg just records a given text into a textbox.

    The winsock properties for wsock(the winsock variable name) are:
    LocalPort : 80
    Protocol: 0-sckTCPProtocol
    RemoteHost:
    RemotePort: 0

    VB Code:
    1. [B]Private Sub Form_Load()[/B]
    2.     Center Me
    3.     Logg "Starting server..."
    4.     wsock.Listen
    5.     Logg "Server running..."
    6.     Logg "Listening through Local Port : " & wsock.LocalPort
    7.     Logg "Current IP Adress : " & wsock.LocalIP
    8. [B]End Sub[/B]

    VB Code:
    1. [B]Private Sub wsock_ConnectionRequest(ByVal requestID As Long)[/B]    wsock.Close
    2.     wsock.Accept requestID
    3.    
    4.     If wsock.State = sckConnected Then
    5.         Logg "Connection request from " & wsock.RemoteHostIP
    6.     End If
    7. [B]End Sub[/B]

    VB Code:
    1. [B]Private Sub wsock_DataArrival(ByVal bytesTotal As Long)[/B]
    2.     Dim dat_in$, v As Variant
    3.  
    4.     wsock.GetData dat_in
    5.        
    6.     Logg "-------- http in --------"
    7.     Logg dat_in
    8.     Logg "-------- http end --------"
    9.    
    10.     tdayname = Format(Now, "dddd")
    11.     tdayname = Left(tdayname, 3)
    12.     tdaynum = Format(Now, "dd") & " "
    13.     tmonth = Format(Now, "mmm") & " "
    14.     tyear = Format(Now, "yyyy") & " "
    15.     thr = Format(Now, "hh")
    16.     thr = Val(thr) + 5
    17.     thr = thr & ":"
    18.     tmn = Format(Now, "mm") & ":"
    19.     tsec = Format(Now, "ss") & " GMT"
    20.    
    21.     ttime = thr & tmn & tsec & Chr(13) & Chr(10)
    22.     sdate = tdayname & ", " & tdaynum & tmonth & tyear & ttime
    23.    
    24.     stitle = "HTTP/1.1 100 Continue" & Chr(13) & Chr(10)
    25.     sheader1 = "Date: " & sdate & Chr(13) & Chr(10)
    26.     sheader2 = "Accept-Language: en-us" & Chr(13) & Chr(10)
    27.     sheader3 = "Accept-Encoding: gzip, deflate" & Chr(13) & Chr(10) & Chr(13) & Chr(10)
    28.    
    29.     sEnvelope = stitle & sheader1 '& sheader2 & sheader3
    30.    
    31.     Logg "-------- http out --------"
    32.     Logg "" & sEnvelope
    33.     Logg "-------- http end --------"
    34.    
    35.     wsock.SendData sEnvelope & "<html><body bgcolor=#FFFF00><center><table border=3> <tr><th colspan=2>Wrong Way Airlines</th></tr><tr> <th>03-03-05<th>Come back soon , this is under construction!</th> </tr> </table></center><br><br>Neat-o Server 1.o <br><br> </body></html>"
    36.     pause 1
    37.     wsock.Close
    38.    
    39.     Do
    40.         DoEvents
    41.     Loop Until wsock.State = sckClosed
    42.     wsock.Listen
    43.    
    44. [B]End Sub[/B]

    VB Code:
    1. [B]Private Sub wsock_Close()[/B]
    2.     Logg "Connection closed from " & wsock.RemoteHostIP
    3.     pause 1
    4.     Timer1.Interval = 1
    5. [B]End Sub[/B]
    ؊Ϯϊ

  10. #10

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: Client not Connecting...

    Sorry to double post but I decided to zip my project and link the source files.

    Server Source Files
    ؊Ϯϊ

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

    Re: Client not Connecting...

    Quote Originally Posted by Osiris
    Sorry to double post but I decided to zip my project and link the source files.

    Server Source Files
    No problem, its best you posted the files

    I can figure out whats wrong, it works when i do it from my own pc running server on my own pc....

    Have you managed to solve this?

  12. #12

    Thread Starter
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: Client not Connecting...

    Quote Originally Posted by Pino
    No problem, its best you posted the files

    I can figure out whats wrong, it works when i do it from my own pc running server on my own pc....

    Have you managed to solve this?
    Yeah, it works fine when I connect to myself from my own computer too... but I still haven't figured out why other people can't to connect to me. I really haven't had enough time to play around with this as to when I started but if I am able to figure it out, I'll post it here.
    ؊Ϯϊ

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