Results 1 to 3 of 3

Thread: winsock

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2005
    Posts
    6

    Arrow winsock

    hi,
    i have assigned the winsock control,
    the client side query disply cannot send the error is
    " wrong protocol or connection state for the requested transaction or request"
    Private Sub Command1_Click()
    Winsock1.RemoteHost = "localhost"
    Winsock1.RemotePort = 8085
    Winsock1.Connect
    Print "connected to server"

    End Sub

    Private Sub Command2_Click()
    sql = Text1.Text
    Winsock1.SendData sql
    Print "sql has been sent to server"
    End Sub

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

    Re: winsock

    Quote Originally Posted by visva
    hi,
    i have assigned the winsock control,
    the client side query disply cannot send the error is
    " wrong protocol or connection state for the requested transaction or request"
    Private Sub Command1_Click()
    Winsock1.RemoteHost = "localhost"
    Winsock1.RemotePort = 8085
    Winsock1.Connect
    Print "connected to server"

    End Sub

    Private Sub Command2_Click()
    sql = Text1.Text
    Winsock1.SendData sql
    Print "sql has been sent to server"
    End Sub
    Hey there welcome to the forums,

    This is our codebank and is used for posting code snippets etc,
    You may get a faster reply if you post in our general forum or in the case of your question in our Distributed Computing (multi-tier development) forum.

    Ok to your question,

    That error happens because you are not conneted

    Print "connected to server" at this point your are not connected to the server but connecting.

    Are you running a server application as well?

  3. #3
    New Member
    Join Date
    Mar 2005
    Posts
    1

    Re: winsock

    Try to close your winsock before Connect.

    If Winsock1.State <> sckClosed Then Winsock1.Close
    Winsock1.RemoteHost = "lolcalhost"
    Winsock1.RemotePort = 8085
    Winsock1.Connect
    Print "connected to server"


    Quote Originally Posted by visva
    hi,
    i have assigned the winsock control,
    the client side query disply cannot send the error is
    " wrong protocol or connection state for the requested transaction or request"
    Private Sub Command1_Click()
    Winsock1.RemoteHost = "localhost"
    Winsock1.RemotePort = 8085
    Winsock1.Connect
    Print "connected to server"

    End Sub

    Private Sub Command2_Click()
    sql = Text1.Text
    Winsock1.SendData sql
    Print "sql has been sent to server"
    End Sub

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