|
-
Jul 6th, 2000, 07:46 PM
#1
Thread Starter
Frenzied Member
Code:
Winsock1.RemoteIP = "127.0.0.1"
Winsock1.RemotePort = 1000
Winsock1.Connect
Dim MyMessage as String
MyMessage = "Hello, My Name Is Steve"
Winsock1.SendData MyMessage
I get an error on the last line of that code. Why?
-
Jul 6th, 2000, 08:30 PM
#2
Thread Starter
Frenzied Member
By the way, ive tried
Winsock1.SendData (MyMessage)
and I still got the error.
-
Jul 6th, 2000, 09:40 PM
#3
Hyperactive Member
It looks like you are connecting to yourself, do you have a server program runnign to listen on that port? Sorry if I sound insulting.
"People who think they know everything are a great annoyance to those of us who do."
-
Jul 7th, 2000, 08:32 AM
#4
Thread Starter
Frenzied Member
No, that form that that code goes into listens to 1001, the server form sends from 1001 and listens to 1000. I asked about how many ports before. Since 1 - 1024 are reserved for http and ftp, do you think the internet is screwing me up and giving me these problems? Maybe I should make the ports lke 2000, and 2001?
-
Jul 7th, 2000, 11:02 AM
#5
Guru
are you using TCP or UDP?
-
Jul 7th, 2000, 11:25 AM
#6
Thread Starter
Frenzied Member
Every winsock control uses TCP
-
Jul 7th, 2000, 03:30 PM
#7
Hyperactive Member
I may be reading your post wrong but it sounds like you've got the way TCP works a bit mixed up.
When you say:
Winsock1.RemoteIP = "127.0.0.1"
Winsock1.RemotePort = 1000
Winsock1.Connect1
There has to already be a server program listening to port 1000 on your machine, otherwise no connection will be established and thus you cant send any data.
"People who think they know everything are a great annoyance to those of us who do."
-
Jul 7th, 2000, 04:35 PM
#8
Thread Starter
Frenzied Member
Sorry, this is my first winsock program. What is the different between TCP and UDT?
-
Jul 7th, 2000, 05:59 PM
#9
Hyperactive Member
The main difference between TCP and UDP is that TCP is connection oriented where UDP isnt. TCP is also much more reliable than UDP. But UDP has a much lower overhead for use then TCP.
This link might help you out with using the control:
http://www.vbsquare.com/internet/comms/
"People who think they know everything are a great annoyance to those of us who do."
-
Jul 7th, 2000, 09:08 PM
#10
Thread Starter
Frenzied Member
Thanks noone! That was the perfect tutorial! Just what I needed!
-
Jul 8th, 2000, 06:37 PM
#11
Junior Member
I would put the SendData command in the Winsock_Connect event. If you send the data before Winsock connects, you'll get an error.
-
Jul 8th, 2000, 07:39 PM
#12
Thread Starter
Frenzied Member
No its connected. The start button (where the senddata is) is dissabled until connected.
-
Jul 9th, 2000, 03:26 PM
#13
Member
What error are you getting?
-
Jul 9th, 2000, 03:28 PM
#14
Thread Starter
Frenzied Member
Hold on, for some reason its working......thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|