473,725 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(D ns.GetHostName) .AddressList(0) , 5124)

I have tried to do it like this:

Code:

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

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.C onnect(_IpEndPo int) '***This don't work when I use an IP
instead of the Dns...

The ERROR message:

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

try this

Dim _ipEndPoint As New IPEndPoint(IPAd dress.Parse("17 2.16.1.1"), 12345)

"BadOmen" <ba*******@hotm ail.com> wrote in message
news:j9******** ************@ne wsc.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(D ns.GetHostName) .AddressList(0) , 5124)

I have tried to do it like this:

Code:

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

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.C onnect(_IpEndPo int) '***This don't work when I use an IP
instead of the Dns...

The ERROR message:

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

Nov 20 '05 #2

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

Similar topics

5
11695
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
6996
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
1248
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...
4
5689
by: James Proctor | last post by:
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.
4
3850
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
25268
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
2208
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
2524
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
9733
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
8884
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8749
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9400
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
9252
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...
0
8084
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
6700
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
4508
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4779
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3217
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.