472,141 Members | 1,477 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

How do I use the IPEndPoint?

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).Addr essList(0), 5124)

I have tried to do it like this:

Code:

Private _IpEndPoint As New IPEndPoint("xxx.xx.xx.xxx",6666)

where the x stands for a IP number... But that will not work...

It generates an error here(In the FAQ winsock code):

Code:

' Call the Socket Connection method passing it the IP
' address and port of this computer (_IpEndPoint)
' This establish the Sockets connection to a remote device.

_ClientSocket.Connect(_IpEndPoint) '***This don't work when I use an IP
instead of the Dns...

The ERROR message:

An unhandled exception of type 'System.Net.Sockets.SocketException' occurred
in system.dll
Additional information: To many references to some kernel-object
Yours, Jonas
Nov 20 '05 #1
1 4095
can you pass a string in the constructor of IPEndPoint?
strange, I can't...

try this

Dim _ipEndPoint As New IPEndPoint(IPAddress.Parse("172.16.1.1"), 12345)

"BadOmen" <ba*******@hotmail.com> wrote in message
news:j9********************@newsc.telia.net...
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).Addr essList(0), 5124)

I have tried to do it like this:

Code:

Private _IpEndPoint As New IPEndPoint("xxx.xx.xx.xxx",6666)

where the x stands for a IP number... But that will not work...

It generates an error here(In the FAQ winsock code):

Code:

' Call the Socket Connection method passing it the IP
' address and port of this computer (_IpEndPoint)
' This establish the Sockets connection to a remote device.

_ClientSocket.Connect(_IpEndPoint) '***This don't work when I use an IP
instead of the Dns...

The ERROR message:

An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll
Additional information: To many references to some kernel-object
Yours, Jonas

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Terry | last post: by
6 posts views Thread by Laxmikant Rashinkar | last post: by
reply views Thread by Tim Mavers | last post: by
4 posts views Thread by James Proctor | last post: by
4 posts views Thread by Rainer Queck | last post: by
5 posts views Thread by Markgoldin | last post: by
reply views Thread by leo001 | last post: by

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.