473,574 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TcpClient and SocketException

Hi,

I am developing a C# application to send requests to mail server to check
email addresses validity. I use a TcpClient object to connect to it with the
Connect(String hostname, Int32 port) method.
When I use my application at home I don't have any problem to connect and
get responses but when I try at work, I get the SocketException number 10061
: "target machine actively refused it". I don't have any proxy, maybe a
firewall.

My question is to know if there is another way to connect the servers (same
problem with sockets) or if there are existing parameters of the TcpClient
object to connect thru a firewall...

Thanks
Oct 18 '06 #1
6 5712
Hello Julien, As far I know, there is no way to do this, you need to open
the port in the firewall to do the connection.

Regards,

Bela Istok
"Julien" <Ju****@discuss ions.microsoft. comwrote in message
news:CC******** *************** ***********@mic rosoft.com...
Hi,

I am developing a C# application to send requests to mail server to check
email addresses validity. I use a TcpClient object to connect to it with
the
Connect(String hostname, Int32 port) method.
When I use my application at home I don't have any problem to connect and
get responses but when I try at work, I get the SocketException number
10061
: "target machine actively refused it". I don't have any proxy, maybe a
firewall.

My question is to know if there is another way to connect the servers
(same
problem with sockets) or if there are existing parameters of the TcpClient
object to connect thru a firewall...

Thanks
Oct 18 '06 #2
Julien

Sounds like you are not permitted to make a connection on the SMTP port
(normally 25) due to firewall restrictions.

--
http://www.hadihariri.com
http://www.malagadnug.org
Oct 18 '06 #3
It's what I was thinking :\

Just another point, when I use email verifier softwares from this network,
it is working. So it could possible to do it !?
"Hadi Hariri" wrote:
Julien

Sounds like you are not permitted to make a connection on the SMTP port
(normally 25) due to firewall restrictions.

--
http://www.hadihariri.com
http://www.malagadnug.org
Oct 20 '06 #4
Julien wrote:
It's what I was thinking :\

Just another point, when I use email verifier softwares from this
network, it is working. So it could possible to do it !?

How does th email verifier work?

--
http://www.hadihariri.com
http://www.malagadnug.org
Oct 20 '06 #5
I don't know but it should connect on the remote smtp server !?
"Hadi Hariri" wrote:
Julien wrote:
It's what I was thinking :\

Just another point, when I use email verifier softwares from this
network, it is working. So it could possible to do it !?

How does th email verifier work?

--
http://www.hadihariri.com
http://www.malagadnug.org
Oct 20 '06 #6
Well what do you define by verified by email? Normally to allow
relaying (not really connection), they either use authentication or POP
before SMTP. You need to know what it's doing to be able to simulate it.
--
http://www.hadihariri.com
http://www.malagadnug.org
Oct 20 '06 #7

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

Similar topics

0
1087
by: Hawk Wu via DotNetMonster.com | last post by:
Hello, I have odd problem. When I close my application wait around 5 minute. The pocket of screen will show one message "System.Net.Sockets.Tcpclient" of message box. My source code as below. Dim t1 as TcpClient Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System. EventArgs) Handles MyBase.Load Dim bf(255) As Byte...
4
6842
by: Sagaert Johan | last post by:
i get this error if i write this : using System.Net.Sockets; .... .... TcpClient tcp; tcp=new TcpClient();
0
1629
by: Sagaert Johan | last post by:
this code using System; using System.Net.Sockets; namespace ConsoleApplication1 { /// <summary> /// Summary description for Class1. /// </summary>
2
3396
by: Kirk | last post by:
Hello, I'm trying to get the current date/time from a (S)NTP server. It works with UdpClient class, but not with TcpClient class. I want to use TcpClient because i can set timeout values for reading/writing operations. The connect method generate a SocketException (10060 : timeout error) : try {
3
2051
by: Peter Stojkovic | last post by:
I have an TcpClient. System.Net.Sockets.TcpClient Everything is working fine. But when the IP-Address is wrong, I DON'T want wait 20seconds for timeout ( seems to be standard ) Is there any possibility to configure the timeout ?? Tnaks Peter
1
2239
by: Frank | last post by:
I wonder if anyone could give me a suggestion on how to best handle this scenario. I wish to have an aspx page contact a server and receive messages. Initially, a login messge is sent, then after being validated, a second message is sent which contains data to complete a stock market trade. The server then should respond not only once, but...
1
1116
by: Frank | last post by:
I wonder if anyone could give me a suggestion on how to best handle this scenario. I wish to have an aspx page contact a server and receive messages. Initially, a login messge is sent, then after being validated, a second message is sent which contains data to complete a stock market trade. The server then should respond not only once, but...
7
15664
by: illegal.prime | last post by:
Hi all, I've got a client/server application and just wanted to ensure that this is expected behavior. I recently set the following configuration in Visual Studio: Debug->Exceptions->Break Into Debugger for the CLR Exceptions And when my debugger hits the TcpClient.Connect statement and the server is not available - I get the following...
1
3252
by: mledbetter | last post by:
I've written a simple web stress tester application using TCPClient. My code was working fine against our web server until our server admin changed IIS security setting by removing anonymous access and adding Integrated windows authentication. Now I get 401 Unauthorized errors. Here is the code that was working: // Make non-secure HTTP...
0
7807
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...
0
7730
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...
0
8241
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...
0
6456
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...
1
5624
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...
0
5301
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3742
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...
1
1344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1061
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...

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.