Results 1 to 10 of 10

Thread: [VB 2005] Send Messages

  1. #1

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    [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

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [VB 2005] Send Messages

    Have you looked into using TCP to send it directly from one pc to the other?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    Re: [VB 2005] Send Messages

    Nope, never heard of TCP before! I'll take a look, thanks.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    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

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,109

    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

  8. #8

    Thread Starter
    Hyperactive Member knxrb's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Posts
    321

    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

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    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
  •  



Click Here to Expand Forum to Full Width