473,698 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

extend System.Net.Sock ets.ProtocolTyp e

hi,

I want to extend System.Net.Sock ets.ProtocolTyp e to IPinIP protocol, how can
i do that.
Do i have to make new class or enum stuct for this type ?

regards
Nov 17 '05 #1
2 2215
centrino,

You can't really extend an existing enumeration (unless you have the
source code).

The best you can do is define the value for the IPinIP protocol as a
constant, or a value in a new enumeration. Then, pass that value to the
Socket constructor, but cast it to the ProtocolType enumeration type. When
casting an int or enumeration to another enumeration type, there is no check
to make sure the value is part of the enumeration.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"centrino" <ce******@discu ssions.microsof t.com> wrote in message
news:18******** *************** ***********@mic rosoft.com...
hi,

I want to extend System.Net.Sock ets.ProtocolTyp e to IPinIP protocol, how
can
i do that.
Do i have to make new class or enum stuct for this type ?

regards

Nov 17 '05 #2
Hi Nicholas,

I can't imagine well how it work .
My IPv4 class hat the attribute TransportProtoc ol of
System.Net.Sock ets.ProtocolTyp e

IPv4 ip = new IPv4();

-> ip.TransportPro tocol = ?

Could U give me some example ?

Thanks !
"Nicholas Paldino [.NET/C# MVP]" wrote:
centrino,

You can't really extend an existing enumeration (unless you have the
source code).

The best you can do is define the value for the IPinIP protocol as a
constant, or a value in a new enumeration. Then, pass that value to the
Socket constructor, but cast it to the ProtocolType enumeration type. When
casting an int or enumeration to another enumeration type, there is no check
to make sure the value is part of the enumeration.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"centrino" <ce******@discu ssions.microsof t.com> wrote in message
news:18******** *************** ***********@mic rosoft.com...
hi,

I want to extend System.Net.Sock ets.ProtocolTyp e to IPinIP protocol, how
can
i do that.
Do i have to make new class or enum stuct for this type ?

regards


Nov 17 '05 #3

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

Similar topics

4
6852
by: Sagaert Johan | last post by:
i get this error if i write this : using System.Net.Sockets; .... .... TcpClient tcp; tcp=new TcpClient();
3
2824
by: Tom Opgenorth | last post by:
I'm experiencing a problem with sockets, and I'm really hoping someone can help me, please and thank you. I've written a TCP Server, which listens on a port for an incoming connection. When the client connects, the connection is NEVER to be closed by the server. The client will send messages as necessary. After each message the server is to send an acknowledgement back to the client. That is the client's indicator to send the next...
3
2235
by: Rudolf | last post by:
Is there a way in VB.Net to implement ping functionality without using raw sockets? I cannot use raw sockets because it has been locked/disabled for security reasons. Thanks Rudolf
0
883
by: mhm | last post by:
Im trying to wrap a socket class and need to get the local port, if any, and local address. when I accept a new connection, I create a new socket, and a new instance of my clsSocket and call the sub New(byval newsocket as Socket). Here's what this looks like: Public Sub New(ByVal newSocket As Socket) If newSocket.AddressFamily = AddressFamily.InterNetwork And _ newSocket.SocketType = SocketType.Stream And _ newSocket.ProtocolType =...
2
2353
by: Stressed Out Developer | last post by:
We have an application that has a 200 count loop that does the following: ' Each time thru the loop we pass the next IP Address is a range (aka 192.168.4.50 thru 192.168.4.254) Try If mUIO_Threads(i) Is Nothing Then mUIO_Threads(i) = New System.Threading.Thread(AddressOf mUIO_DAQ(i).InitDAQ) mUIO_Threads(i).Name = mUIO_DAQ(i).UIO_IPAddr mUIO_Threads(i).IsBackground = False
6
13009
by: Aero | last post by:
Hi, My window application written in C# is throwing following exception while connecting to one FTP location The type initializer for System.Net.Sockets.Socket threw an exception This exe is working fine on staging environment, (Window 2003) but after migrating to production environment (Windows 2000), throwing this exception at
6
3119
by: buc | last post by:
Why does VB.NET UDP sockets send data on random ports?. If I set a simple socket up to transmit a UDP packet on a port, look at the packet with a sniffer, the actual packets source port and dest.port are diff. The packets destination port is correct, but the packets source port it is actually sent from is random. Why? How can I figure out the actual source port windows is using, not what the vb.net socket is fake reporting? Thanks BUC
6
2793
by: Ioannis Papadopoulos | last post by:
I would like to extend the functionality of all streams in C++ so I can do some fancy stuff like redirecting the streams on the fly. I don't want to reimplement the whole stream support in C++ and I would like to keep as much as possible that is already existing. However, the only thing that my user would like to see is the following #include "myiostream.hpp"
2
1773
by: com64 | last post by:
Hey all, I'm a casual/hobby programmer who's always used VB6. I'm trying out VB 2008 express edition now. I understand a few basic concepts about .Net, but am doing this by myself with no more help than Google. I dont want to do anything fancy, just connect 2 machines to chat and play chess. I used the Winsock control in VB6, and have spent the last 4 hours or so googling to the conclusion that it's been replaced (?) with namespace...
0
8673
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
9156
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...
1
8892
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
7716
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
6518
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
4365
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...
1
3043
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
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1998
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.