dcsimg
Results 1 to 8 of 8

Thread: Winsock Question

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,073

    Winsock Question

    Can I use one Winsock control for both Client and Server whichever it turns out to be?

    I want two apps both able to connect to each other and listen for a connection from the other side


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,720

    Re: Winsock Question

    If the Winsock control is listening then it cannot connect, and vice versa. But it is possible to flip between modes of operation.

    Here is one I had lying around:

    Name:  sshot chat.png
Views: 68
Size:  25.5 KB
    Attached Files Attached Files

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,073

    Re: Winsock Question

    When I click on your link I get following message:

    File 'Unicode1on1 Chat.zip' appears malicious


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,720

    Re: Winsock Question

    Interesting, since it contains nothing but source code.

  5. #5
    Addicted Member
    Join Date
    Sep 2013
    Posts
    190

    Re: Winsock Question

    Use winsock for the client, and winsock with an Index of 0 for the listening server. Make the server load a new winsock for each connection. That's how you accept multiple connections.
    And it says it's malicious because it's a vb extension. I have Chrome and it does that to me every time.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,073

    Re: Winsock Question

    Quote Originally Posted by Conroy Vanderbluff View Post
    Use winsock for the client, and winsock with an Index of 0 for the listening server. Make the server load a new winsock for each connection. That's how you accept multiple connections.
    I already know that but that wasn't my question. It's not for multiple connections; it's only for two-way communication where either side can be either the client or the server depending on who connects to who. I was just wondering if that can be done using only one Winsock per side instead of two Winsocks per side.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,073

    Re: Winsock Question

    Quote Originally Posted by dilettante View Post

    Here is one I had lying around:
    That is exactly what I needed. Thanks, dile


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    20,720

    Re: Winsock Question

    Sheesh.

    Name:  Dead End.jpg
Views: 53
Size:  28.9 KB

    Welcome to the end of the WWW, hope you had a nice ride!


    Glad you finally got through the screening software at your end.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width