Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - VB.NET -- Creating an asynchronous socket
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

VB.NET -- Creating an asynchronous socket

 Post Reply Post Reply
Author
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Topic: VB.NET -- Creating an asynchronous socket
    Posted: 30 April 2004 at 4:30pm

Hey all,

I need to build this IRC bot, and I have to create a socket and a listener to send/recieve commands. It has to be asynchronous because it will take a huge number of requests.

Now I searched the internet (woot) and found some stuff, but none of them actually worked . So that's why I just wanted to ask you guys if you have any experience of sending and recieving data from and to a server.

I tought I created a nice piece of code, but it got all messed up whenever I tried to connect. The MSDN library has some articles, but I managed to get NONE of them to work.

Gone..
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2004 at 11:35pm

Did you download the .net 101 code samples? They have a pretty need sample for a socket server and client, don't recall if async.

http://www.microsoft.com/downloads/details.aspx?FamilyId=08E 3D5F8-033D-420B-A3B1-3074505C03F3&displaylang=en

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 3:46am
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 8:09am
Thx, I'll have a look
Gone..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 10:50am

That article actually tackles a server, to do a client you just need to delete all the TcpListener Stuff and make a new TcpClient like this:

Dim objTcpc As New TcpClient

and use the connect method like this:

objTcpc.Connect("hostname.com", 80)

You do all the reading and writing the same way.

Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 1:47pm
Well, a client needs to recieve right? I can't just keep sending data to a server without knowing what it responses.
Gone..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 2:47pm
You can receive data...
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 5:04pm
Originally posted by michael michael wrote:

Did you download the .net 101 code samples? They have a pretty need sample for a socket server and client, don't recall if async.

http://www.microsoft.com/downloads/details.aspx?FamilyId=08E 3D5F8-033D-420B-A3B1-3074505C03F3&displaylang=en

Thanks! This is pretty much all I need, thanks very much all!

Gone..
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.