|
-
Sep 11th, 2007, 05:15 AM
#1
Thread Starter
Hyperactive Member
[VB 2005] Send Messages
Basically, I need to send messages to another computer somewhere else in the world but it's too slow at the moment.
I'm currently using (the slowest method possible) .txt files and streamwriters and streamreaders.
The application is writing to a text file and then uploading it to a server every 20 seconds. Then every 20 seconds the other person is downloading the file and reading it into the application.
It's incredibly slow and I can't lower the time from 20 seconds to 2 seconds because it comes up with an error message(something about timeout etc.).
Is there anyway that I can either have it download/upload every 2 seconds or have some other system to send the messages?
Thanks in advance.
------
KNXRB
-
Sep 11th, 2007, 05:20 AM
#2
Re: [VB 2005] Send Messages
Have you looked into using TCP to send it directly from one pc to the other?
-
Sep 11th, 2007, 08:12 AM
#3
Thread Starter
Hyperactive Member
Re: [VB 2005] Send Messages
Nope, never heard of TCP before! I'll take a look, thanks.
-
Sep 11th, 2007, 08:17 AM
#4
Re: [VB 2005] Send Messages
TCP... as in TCP/IP... as in the the protocol used to communicate over the Internet and virtually every LAN installed in living memory. take a look at the TcpListener and TcpClient classes.
-
Sep 11th, 2007, 08:25 AM
#5
Thread Starter
Hyperactive Member
Re: [VB 2005] Send Messages
i've searched for tcp and:
what are packets?
what's a tcplistener?
Does anyone have any working code that will allow me to send some text to another pc pleasE?
------
KNXRB
-
Sep 11th, 2007, 08:31 AM
#6
Re: [VB 2005] Send Messages
If you type tcplistener into the MSDN library search box then you'll be provided with a link to the help topic for the TcpListener class. The first line in that help topic says:
Listens for connections from TCP network clients.
You don't need programming expertise to use a search engine.
-
Sep 11th, 2007, 09:28 AM
#7
Re: [VB 2005] Send Messages
By the way, how large are these messages? If they are fairly small (512 bytes) or so, then you might also look at UDP. UDP is much less common, but has a few advantages in some situations.
My usual boring signature: Nothing
 
-
Sep 12th, 2007, 03:35 AM
#8
Thread Starter
Hyperactive Member
Re: [VB 2005] Send Messages
I've looked for udp but i can't find anything. Anyone got any code that let's me send a message after clicking button?
And recieve it and put it into a textbox called txtmain?
------
KNXRB
-
Sep 12th, 2007, 04:36 AM
#9
Re: [VB 2005] Send Messages
I really do wonder where on earth people actually look when they say they can't find anything sometimes. I just Googled udp ".net" and the first two matches were .NET Framework Developer's Guide: TCP/UDP at MSDN and UDP application for VB.NET at the Code Project. All that's missing is the bow on top.
-
Sep 12th, 2007, 04:38 AM
#10
Re: [VB 2005] Send Messages
I found everything needed to connect two applications using th SEARCH function of this forum!
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
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
|