.Net Sockets

Anton-
08-08-2004, 05:06 PM
Hi,

I wonder if somebody could kindly explain how I can do the following.

I currently have a .NET application that uses the com port (rs232.vb). My application sends and receives ASCII text.

I would like to allow the option of connnecting via Ethernet.

Can somebody exaplain with examples how I can set this up?

I would like info on how to connect to IP address x.x.x.x port xxxx and then send simple ascii using the write command.

I have done some research on .NET sockets but it appears unbelievably complex to do such a simple task.

Many Thanks.

Anton-
08-09-2004, 03:49 AM
Since my last email I see that somebody has posted the following code:

Private Sub Winsock1_Connect()
Form1.Caption = "Sent - " & Time
Winsock1.SendData Text1.Text & vbcrlf
End Sub

Looks very simple, just what I am after. If I wanted to use winsock in vb.net how do I get it installed and where does my reference to the IP address I want to connect to go?

I can answer any advanced electronics questions that you guys have!

Please see my initial email above, if using VB.NET sockets is the best way then please can somebody explain how?

Please don't post multiple threads on the same subject. If you need to clarify a question or add more information, do so as a reply to your original thread. Thanks.

Anton-
08-17-2004, 11:00 AM
Its great when you figure things out for yourself.

The previous thread explained how I could connect via TCP/IP but it would take 15+ secs to connect.

If connecting via IP address then the address must be converted to system.net ip address using parse:

Dim ipAddress As IPAddress = ipAddress.Parse(ethernetip.Text)

Regards,
Anton

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum