Results 1 to 6 of 6

Thread: Basic Winsock Server Code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Posts
    70

    Question

    Greetings,
    Can someone let me in on the basic code to listen with the winsock ocx on a socket, accept the connection, create a new winsock control that will then go back to listening on the same port?
    Thanks
    Daniel Rose
    VB 5.0 Enterprise.
    irc:irc2.dynam.ac

    If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    See the MSDN page Using the Winsock Control.

    If you need to send/receive record type structures, let me know. There are some important issues that you need to be aware of.

  3. #3
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    If you need help write back
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2000
    Posts
    70

    Lightbulb

    Well, i just really want to know how to generate a new control 'on the fly' in code.
    Daniel Rose
    VB 5.0 Enterprise.
    irc:irc2.dynam.ac

    If TheCodeInTheSig() Is Not Lame() Then IDontKnowWhatIs()

  5. #5
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    your listening sock should have a index of (0)
    dim NextSock as integer

    sock(0).listen

    in the sock connect_request

    NextSock=NextSock+1

    load sock(NextSock)

    sock(NextSock).Accept RequestID

    the listening sock's state is never changed the connection requests are accepted on new socks


    Kurt Simons
    [I know I'm a hack but my clients don't!]

  6. #6
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    CAPHS wrote:
    Well, i just really want to know how to generate a new control 'on the fly' in code.
    Did you look at the MSDN page? What you want is described there. With code examples.

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