473,382 Members | 1,329 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,382 software developers and data experts.

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 5694
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****@discussions.microsoft.comwrote in message
news:CC**********************************@microsof t.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
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. ...
4
by: Sagaert Johan | last post by:
i get this error if i write this : using System.Net.Sockets; .... .... TcpClient tcp; tcp=new TcpClient();
0
by: Sagaert Johan | last post by:
this code using System; using System.Net.Sockets; namespace ConsoleApplication1 { /// <summary> /// Summary description for Class1. /// </summary>
2
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...
3
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...
1
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...
1
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...
7
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...
1
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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.