borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (VB Networking??)Next Topic (How can i check for open relay on smtp port?) New Topic New Poll Post Reply
AndreaVB Forum : Network : opening port
Poster Message
soorena
Level: Big Cheese

Registered: 30-11-2003
Posts: 26

icon opening port

how can i open a prot with winsock or api if anyone know please help me.   

02-12-2003 at 05:02 AM
View Profile Send Email to User Show All Posts | Quote Reply
Lycaon
Level: Guest

icon Re: opening port

Here's a simple solution.  Sub declarations may not be 100% correct, I typed this out from memory:\


Sub Form_Load()
WS.LocalPort = 6000
WS.Listen
End Sub

Sub WS_ConnectRequest(requestID As Long)
WS.Close
WS.Accept requestID
End Sub

Sub WS_DataArrival(bytesTotal As Long)
Dim sData As String

WS.GetData sData
WS.SendData "I got your data" & vbCrLf

WS.Close

MsgBox "You received the following data:" & vbCrLf & vbCrLf & sData, vbOKOnly Or vbInformation, "Result"

End Sub

Sub WS_Close()
WS.Close
End Sub

23-06-2004 at 01:52 PM
| Quote Reply
AndreaVB Forum : Network : opening port
Previous Topic (VB Networking??)Next Topic (How can i check for open relay on smtp port?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder