Results 1 to 9 of 9

Thread: How to use Winsock

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    19

    How to use Winsock

    Hello everybody! As I wrote in the title, I'd like to find out how winsock works and why doesnt work in my program.

    Here what I did; I've got a form with 3 textbox, two commands, one label and one sock.

    here is the code:
    VB Code:
    1. Private Sub Command1_Click()
    2. On Error Resume Next
    3. Sock.SendData Text1.Text
    4.  
    5.  
    6. End Sub
    7.  
    8. Private Sub Command2_Click()
    9.  
    10. If Sock.State = 0 Then
    11. Sock.Connect Text2.Text, Text3.Text
    12. End If
    13.  
    14. End Sub
    15.  
    16.  
    17. Private Sub Form_Load()
    18. Text2.Text = Sock.LocalIP
    19. End Sub
    20.  
    21. Private Sub Sock_DataArrival(ByVal bytesTotal As Long)
    22. Label3.Caption = Sock.GetData
    23.  
    24. End Sub

    WHAT I WANT TO DO is
    -send a string to the specified IP
    OR
    -recieve a string.

    It does not work and I cannot understand the "Status" property.

    Any hint?
    Thanks a lot!

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: How to use Winsock

    where it will be received...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    19

    Re: How to use Winsock

    Er, what do you mean?
    Maybe WHAT will be recieving? The program was mean to recieve itself..

  4. #4
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: How to use Winsock

    winsock is for transferring data....are you sending and receiving from the same computer....
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  5. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    19

    Re: How to use Winsock

    No well... I know winsock is for transferring data...
    I want to install my program on TWO computers in order to transfer data from one to other and viceversa.

  6. #6
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: How to use Winsock

    then you have to use two different winsock controls and one to accept the data and the other to send...

    google for sample codes in this forum or in msdn...you will find lots
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  7. #7
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: How to use Winsock

    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  8. #8

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Posts
    19

    Re: How to use Winsock

    Thanks a lot, I'm checking it now!

  9. #9
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: How to use Winsock

    here is all you need

    www.winsockvb.com
    Chris

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