problems to connect, winsock.state = 6 ?? 
Author Message
 problems to connect, winsock.state = 6 ??

Hello. I got i little problem.
I only want to connect to a computer on port 80 and send a command.
After connecting winsock.state = 6. I hasn't found any description for that
code.

    Dim server As String, port As Long, postdata As String
    server = "192.168.1.1"
    port = "80"
    postdata = urlformat(txtpost.Text)
    If Winsock1.State = 0 Then
        Winsock1.RemoteHost = txtserver
        Winsock1.RemotePort = port
        Winsock1.Connect
    End If

    Winsock1.SendData (postdata & nl & nl)



Wed, 26 Feb 2003 01:33:57 GMT  
 problems to connect, winsock.state = 6 ??
State 6 is a connecting state.  Are you sure you want to use port 80?
Quote:

>Hello. I got i little problem.
>I only want to connect to a computer on port 80 and send a command.
>After connecting winsock.state = 6. I hasn't found any description for that
>code.

>    Dim server As String, port As Long, postdata As String
>    server = "192.168.1.1"
>    port = "80"
>    postdata = urlformat(txtpost.Text)
>    If Winsock1.State = 0 Then
>        Winsock1.RemoteHost = txtserver
>        Winsock1.RemotePort = port
>        Winsock1.Connect
>    End If

>    Winsock1.SendData (postdata & nl & nl)



Thu, 27 Feb 2003 19:36:50 GMT  
 problems to connect, winsock.state = 6 ??

Quote:
>Hello. I got i little problem.
>I only want to connect to a computer on port 80 and send a command.
>After connecting winsock.state = 6. I hasn't found any description for that
>code.

>    Dim server As String, port As Long, postdata As String
>    server = "192.168.1.1"
>    port = "80"
>    postdata = urlformat(txtpost.Text)
>    If Winsock1.State = 0 Then
>        Winsock1.RemoteHost = txtserver

Try changing
Winsock1.RemoteHost = txtserver
    to
Winsock1.RemoteHost = server

That may work.

Quote:
>        Winsock1.RemotePort = port
>        Winsock1.Connect
>    End If

>    Winsock1.SendData (postdata & nl & nl)

Hope this helps out.
-Rick

____________________________________________________
Download VB Code at : http://developer.teklar.com/
Visit my web site at : http://www.teklar.com/



Fri, 28 Feb 2003 07:21:06 GMT  
 problems to connect, winsock.state = 6 ??

The problem is port number. I believed ports up to 512 is reserved. Try port
1001. It might work (like i did).

Quote:
> Hello. I got i little problem.
> I only want to connect to a computer on port 80 and send a command.
> After connecting winsock.state = 6. I hasn't found any description for
that
> code.

>     Dim server As String, port As Long, postdata As String
>     server = "192.168.1.1"
>     port = "80"
>     postdata = urlformat(txtpost.Text)
>     If Winsock1.State = 0 Then
>         Winsock1.RemoteHost = txtserver
>         Winsock1.RemotePort = port
>         Winsock1.Connect
>     End If

>     Winsock1.SendData (postdata & nl & nl)



Sat, 08 Mar 2003 03:00:00 GMT  
 problems to connect, winsock.state = 6 ??
Not true...  Port numbers are generally open on a system (there may be
a couple of exceptions), but port 80 is not reserved by the system.
Port 80 is the standard for HTTP and is left open unless you are
running an HTTP server (and specifically running it on port 80).

Cheers,

Joseph



Quote:

> The problem is port number. I believed ports up to 512 is reserved.
Try port
> 1001. It might work (like i did).


> > Hello. I got i little problem.
> > I only want to connect to a computer on port 80 and send a command.
> > After connecting winsock.state = 6. I hasn't found any description
for
> that
> > code.

> >     Dim server As String, port As Long, postdata As String
> >     server = "192.168.1.1"
> >     port = "80"
> >     postdata = urlformat(txtpost.Text)
> >     If Winsock1.State = 0 Then
> >         Winsock1.RemoteHost = txtserver
> >         Winsock1.RemotePort = port
> >         Winsock1.Connect
> >     End If

> >     Winsock1.SendData (postdata & nl & nl)

Sent via Deja.com http://www.deja.com/
Before you buy.


Mon, 10 Mar 2003 03:00:00 GMT  
 problems to connect, winsock.state = 6 ??
I agree with Rpent about using server instead of txtserver ( I wouldn't use
word server - who knows).
Also look at the port value "80", it declared as Long.
Quote:

> Hello. I got i little problem.
> I only want to connect to a computer on port 80 and send a command.
> After connecting winsock.state = 6. I hasn't found any description for that
> code.

>     Dim server As String, port As Long, postdata As String
>     server = "192.168.1.1"
>     port = "80"
>     postdata = urlformat(txtpost.Text)
>     If Winsock1.State = 0 Then
>         Winsock1.RemoteHost = txtserver
>         Winsock1.RemotePort = port
>         Winsock1.Connect
>     End If

>     Winsock1.SendData (postdata & nl & nl)



Sun, 30 Mar 2003 03:00:00 GMT  
 problems to connect, winsock.state = 6 ??
Take a look at VB's help for the Winsock.State property.  It lists the
appropriate values for the various states and and indicates that
6=vbConnecting
whereas 7=vbConnected.

I found that it's best to respond to a connection via the Winsock_Connect
event..

Hope this helps (didn't see the original message so don't know if I'm even
close to what the question was)

Shawn


Quote:
> I agree with Rpent about using server instead of txtserver ( I wouldn't
use
> word server - who knows).
> Also look at the port value "80", it declared as Long.


> > Hello. I got i little problem.
> > I only want to connect to a computer on port 80 and send a command.
> > After connecting winsock.state = 6. I hasn't found any description for
that
> > code.

> >     Dim server As String, port As Long, postdata As String
> >     server = "192.168.1.1"
> >     port = "80"
> >     postdata = urlformat(txtpost.Text)
> >     If Winsock1.State = 0 Then
> >         Winsock1.RemoteHost = txtserver
> >         Winsock1.RemotePort = port
> >         Winsock1.Connect
> >     End If

> >     Winsock1.SendData (postdata & nl & nl)



Mon, 31 Mar 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. WinSock : Connect failed, .State = sckError

2. Winsock Current State Problem

3. Winsock Connect problem

4. winsock control--connect method problem

5. HELP - Winsock.ocx connect problem

6. Winsock Control in VB5 Connect Problem.

7. winsock control--connect method problem

8. Problem with winsock connect() in VB

9. Winsock Control Not Connecting and Staying in Status 6 (Connecting)

10. Problems with TCP Connect / Winsock Control

11. Winsock Control in VB5 Connect Problem.

12. Problem with winsock connect() in VB

 

 
Powered by phpBB® Forum Software