473,385 Members | 1,647 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.

Very Urgent

hi,
I have already tried this URL's code
"http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm"
but I am getting error when i am creating a UDP type Socket and recieving
packet from this socket.
some time error is---"An existing connection was forcibly closed by the
remote host"
and some time error is---
"A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond"
i am using this code for

try

{

IPHostEntry ihe = Dns.GetHostEntry(host);

IPEndPoint iep = new IPEndPoint(ihe.AddressList[0], 161);

EndPoint ep = (EndPoint)iep;

Socket sock = new Socket(ep.AddressFamily, SocketType.Dgram,
ProtocolType.Udp);
sock.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveTimeout, 1000);

sock.Connect(iep);
sock.SendTo(packet, snmplen, SocketFlags.None, iep);

//Receive response from packet

try

{

packet = new byte[1024];

int recv = sock.ReceiveFrom(packet, ref ep);
//here I am getting above written exceptions

catch (SocketException ex)

{

packet[0] = 0xff;

}

pls help me out of this its very urgent.
thanks
alok sengar


"Greg Young" <dr*******************@hotmail.com> wrote in message
news:Of**************@TK2MSFTNGP05.phx.gbl...
There are numerous open source libraries ...Might be beneficial to look
through some already working code (or just use one as is as opposed to
making another wheel :)).

check out
http://www.c-sharpcorner.com/Code/2002/Sept/SnmpLib.asp
http://www.java2s.com/Code/CSharp/Ne...SimpleSNMP.htm
http://net-snmp.sourceforge.net/

Cheers,

Greg Young
MVP - C#
http://geekswithblogs.net/gyoung

"alok sengar" <al*********@suviinfo.com> wrote in message
news:O4**************@TK2MSFTNGP02.phx.gbl...
hi sir/mam,

I am facing problem when i am developing a application to
implement SNMP protocol using C#.net
can u tell me how can i implement SNMP protocol in .net
please reply me soon
thanks
alok sengar



Jun 8 '06 #1
0 1074

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

Similar topics

1
by: samir dsf | last post by:
hi this is kinda urgent ... i will insert some data in html format..i just need to know how to disply it back.its urgent...so if anyone can suggest pls tell me i simply need to know that if i...
33
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
4
by: archana | last post by:
Hi all, I am having one confusion regarding invoking web method of web service asychronously through windows applicaiton. What i am doing is i am having one long runing web method whose one...
1
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
1
by: sohail28 | last post by:
Respected Sir, I try to connect my DB which is present in my hosting server control panel using Dreamweaver MX 2004. Everything is going fine, except while testing connection configuration, its...
3
by: settyv | last post by:
Hi, I need to generate PDF stream when i click on Linkbutton in datagrid ..At present i hardcoded the DMS Id and now it is working.But i need to pass DMS ID when click linkbutton.How can i do...
1
by: rajesh.us.it.recruiter | last post by:
Hi Guys/Partners, We have a URGENT Requirement for Perl Programmer with H1 visa in India/US for one of our prestigious Client. Location : New Jersey Requirements : Should be very strong in...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
9
by: uppili4chi | last post by:
Good morning my dear friends, I am uppili from India. i am working in one mnc. I need a help very urgent. "My problem i need to write a program for search a file just like search option at...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.