473,385 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

extend System.Net.Sockets.ProtocolType

hi,

I want to extend System.Net.Sockets.ProtocolType 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 2195
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.com

"centrino" <ce******@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
hi,

I want to extend System.Net.Sockets.ProtocolType 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 TransportProtocol of
System.Net.Sockets.ProtocolType

IPv4 ip = new IPv4();

-> ip.TransportProtocol = ?

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.com

"centrino" <ce******@discussions.microsoft.com> wrote in message
news:18**********************************@microsof t.com...
hi,

I want to extend System.Net.Sockets.ProtocolType 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
by: Sagaert Johan | last post by:
i get this error if i write this : using System.Net.Sockets; .... .... TcpClient tcp; tcp=new TcpClient();
3
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...
3
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
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 ...
2
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...
6
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...
6
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...
6
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++...
2
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.