473,839 Members | 1,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IPEndPoint

Hi there, im trying to write a application that has some
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.

Regards

James
Nov 20 '05 #1
4 5691
"James Proctor" <ja**********@e bmis.co.uk> schrieb
Hi there, im trying to write a application that has some
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.


The constructor is overloaded.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
James,

Try:

Dim IPHost As IPHostEntry = Dns.Resolve(m_s HostName)
Dim Aliases() As String = IPHost.Aliases
Dim Addr() As IPAddress = IPHost.AddressL ist

IPEndPoint = New IPEndPoint(Addr (0), 1000)

m_sHostName can be an IP address or URL.

Steve
-----Original Message-----
Hi there, im trying to write a application that has some
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.

Regards

James
.

Nov 20 '05 #3
* "James Proctor" <ja**********@e bmis.co.uk> scripsit:
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.


There is an overloaded ctor available which expects an IP Address:

\\\
Public Sub New(IPAddress, Integer)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
In article <06************ *************** *@phx.gbl>, James Proctor wrote:
Hi there, im trying to write a application that has some
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.

Regards

James


Dim ep As IPEndPoint = New IPEndPoint( _
IPAddress.Parse ("192.0.0.01 "), 1000)

HTH
--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
11726
by: Terry | last post by:
It's my understanding of UDP sockets that if there is a thread blocked on a "recvFrom()" call and other thread sends a UDP packet to some address, that if the machine on the other end isn't up, that the "recvFrom()" call should just continue blocking. Right? What I'm seeing is that when I send a packet to a particular address that is not responding, my "recvFrom()" call throws an exception. I get "An existing connection was forcibly...
6
7009
by: Laxmikant Rashinkar | last post by:
Is there any way to use a C# socket in promiscuous mode? Any sample code that shows how this is done? any assistance is much appreciated! thanks LK
0
1252
by: Tim Mavers | last post by:
I am trying to use the ANTS Profiling service to profile a .NET web app (on my machine). I have XP SP2 with the Firewall turned off (my company's security policy sets this). I have talked to ANTS support, but they have no idea. The service is running and listening on port 8087 (as expected). I have tried connected with localhost, my machine name, my ip address, and always get the same error. The .NET web app runs fine and is also...
1
4416
by: BadOmen | last post by:
Hi, This is used in a FAQ and it works fine wile connecting to my computer but I want to connect to an other... Original code: Code: Private _IpEndPoint As New IPEndPoint(Dns.GetHostByName(Dns.GetHostName).AddressList(0), 5124)
4
3851
by: Rainer Queck | last post by:
Hi NG, what is wrong with the following code? Sender and Revceiver are of the Type IPEndPoint. //================= bool IsEqual = tlg.Receiver.Equals(aTlg.Sender); if(tlg.Receiver.Address == aTlg.Sender.Address) { if(tlg.Receiver.Port == aTlg.Sender.Port)
14
25291
by: DaTurk | last post by:
I am makeing a Multicast server client setup and was wondering what the difference is between Socket.Connect, and Socket.Bind. It may be a stupid question, but I was just curious. Because I tried a test, and I can't bind two sockets to the same port/ip but I can connect with one socket, and bind with another to the same ip/port. Thanks
0
2213
by: tccode97 | last post by:
To whom it may concern, I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link http://msdn2.microsoft.com/en-us/library/system.net.sockets.udpclient.beginreceive.aspx First of all, thanks for microsoft team for this post.
1
2528
by: tccode97 | last post by:
Hi, I need an urgent help. I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link http://msdn2.microsoft.com/en-us/library/system.net.sockets.udpclient...
5
9739
by: Markgoldin | last post by:
I am searching for a solution of sending messages from not .Net process into a .Net process written in C#. I have gone already thru sockets solution and have porblems with it. I am not a C# coder dont kill :) I am thinking about something like this: A remote non .Net process has a window with a name known to .Net program. Can .Net program somehow process that window using window's title and extracting a text from it? What other solutions...
0
10906
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10585
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10647
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10292
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7828
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7017
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3132
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.