473,671 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

socket programming

Hi All,

I am doing socket programming.

Client is in C#.Net 2003 and Server is in VC++ 6.0

When Server uses csoc class than it connect & communicate to client without
any problem....

while it uses api on server side so it is not able to connect it throws an
error no 10061...

System.Net.Sock ets.SocketExcep tion: No connection could be made because the
targ
et machine actively refused it
at System.Net.Sock ets.Socket.Conn ect(EndPoint remoteEP)

pls help me its urgent

if any socket api in c#.net then pls give me link or details abt that

Thanx & Regards....

--
Ather Murtuzapurwala
Software Engineer
Mumbai,India

A man of trial is a man of success

Nov 16 '05 #1
5 4722
Hi,

My guess is that you are using an incorrect combination of port/ip

In .NET you use the System.Net.Sock ets or System.Net classes for sockets
comm.
My advice is that you use TcpClient instead of Socket for simple
communications.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"AtherMurtuzapu rwala" <At************ *****@discussio ns.microsoft.co m> wrote
in message news:7B******** *************** ***********@mic rosoft.com...
Hi All,

I am doing socket programming.

Client is in C#.Net 2003 and Server is in VC++ 6.0

When Server uses csoc class than it connect & communicate to client
without
any problem....

while it uses api on server side so it is not able to connect it throws an
error no 10061...

System.Net.Sock ets.SocketExcep tion: No connection could be made because
the
targ
et machine actively refused it
at System.Net.Sock ets.Socket.Conn ect(EndPoint remoteEP)

pls help me its urgent

if any socket api in c#.net then pls give me link or details abt that

Thanx & Regards....

--
Ather Murtuzapurwala
Software Engineer
Mumbai,India

A man of trial is a man of success

Nov 16 '05 #2
Also, I would say, did you look at the ErrorCode property on the
exception that was thrown? It will return the value from the last API call
when an exception was thrown, and you should see more detailed error
information from that.

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

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:OD******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

My guess is that you are using an incorrect combination of port/ip

In .NET you use the System.Net.Sock ets or System.Net classes for sockets
comm.
My advice is that you use TcpClient instead of Socket for simple
communications.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"AtherMurtuzapu rwala" <At************ *****@discussio ns.microsoft.co m>
wrote in message
news:7B******** *************** ***********@mic rosoft.com...
Hi All,

I am doing socket programming.

Client is in C#.Net 2003 and Server is in VC++ 6.0

When Server uses csoc class than it connect & communicate to client
without
any problem....

while it uses api on server side so it is not able to connect it throws
an
error no 10061...

System.Net.Sock ets.SocketExcep tion: No connection could be made because
the
targ
et machine actively refused it
at System.Net.Sock ets.Socket.Conn ect(EndPoint remoteEP)

pls help me its urgent

if any socket api in c#.net then pls give me link or details abt that

Thanx & Regards....

--
Ather Murtuzapurwala
Software Engineer
Mumbai,India

A man of trial is a man of success


Nov 16 '05 #3
Hi,

I forgot to mention, try a telnet to the ip & port from a command prompt
and see if you can connect, if you get a complete blank screen you are
connected.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"AtherMurtuzapu rwala" <At************ *****@discussio ns.microsoft.co m> wrote
in message news:7B******** *************** ***********@mic rosoft.com...
Hi All,

I am doing socket programming.

Client is in C#.Net 2003 and Server is in VC++ 6.0

When Server uses csoc class than it connect & communicate to client
without
any problem....

while it uses api on server side so it is not able to connect it throws an
error no 10061...

System.Net.Sock ets.SocketExcep tion: No connection could be made because
the
targ
et machine actively refused it
at System.Net.Sock ets.Socket.Conn ect(EndPoint remoteEP)

pls help me its urgent

if any socket api in c#.net then pls give me link or details abt that

Thanx & Regards....

--
Ather Murtuzapurwala
Software Engineer
Mumbai,India

A man of trial is a man of success

Nov 16 '05 #4
Dummy question on this topic.

When you are establishing connections, to a server it opens a connection and
you can see it in netstat. What if you open another connection from the same
source computer to the same destination computer. Will it see that it
already has one and just use it? Or is there a way to force it to keep
opening new ones. We are building a test tool to throw load at it, and we
appear to be only using 2 connecitons and can not throw enough load at it

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

I forgot to mention, try a telnet to the ip & port from a command prompt
and see if you can connect, if you get a complete blank screen you are
connected.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"AtherMurtuzapu rwala" <At************ *****@discussio ns.microsoft.co m> wrote
in message news:7B******** *************** ***********@mic rosoft.com...
Hi All,

I am doing socket programming.

Client is in C#.Net 2003 and Server is in VC++ 6.0

When Server uses csoc class than it connect & communicate to client
without
any problem....

while it uses api on server side so it is not able to connect it throws an
error no 10061...

System.Net.Sock ets.SocketExcep tion: No connection could be made because
the
targ
et machine actively refused it
at System.Net.Sock ets.Socket.Conn ect(EndPoint remoteEP)

pls help me its urgent

if any socket api in c#.net then pls give me link or details abt that

Thanx & Regards....

--
Ather Murtuzapurwala
Software Engineer
Mumbai,India

A man of trial is a man of success


Nov 16 '05 #5
Hi Chris,
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:C4******** *************** ***********@mic rosoft.com...
Dummy question on this topic.

When you are establishing connections, to a server it opens a connection
and
you can see it in netstat. What if you open another connection from the
same
source computer to the same destination computer.
A new connection will be established ( if the server does support it ) ,
See a connection with 4 components , Source IP, Source Port, target IP,
target port. that combination has to be unique.
What happen is that you do not especify the source port and a different
port is used each time you open a new connection.

What needs to be unique is the process listening in a particular port in
the server side. normally a process that is blocked waiting a connection,
once it gets it i create another thread to service this connection and goes
back to block until the next connection request arrive.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Will it see that it
already has one and just use it? Or is there a way to force it to keep
opening new ones. We are building a test tool to throw load at it, and we
appear to be only using 2 connecitons and can not throw enough load at it

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

I forgot to mention, try a telnet to the ip & port from a command prompt
and see if you can connect, if you get a complete blank screen you are
connected.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"AtherMurtuzapu rwala" <At************ *****@discussio ns.microsoft.co m>
wrote
in message news:7B******** *************** ***********@mic rosoft.com...
> Hi All,
>
> I am doing socket programming.
>
> Client is in C#.Net 2003 and Server is in VC++ 6.0
>
> When Server uses csoc class than it connect & communicate to client
> without
> any problem....
>
> while it uses api on server side so it is not able to connect it throws
> an
> error no 10061...
>
> System.Net.Sock ets.SocketExcep tion: No connection could be made because
> the
> targ
> et machine actively refused it
> at System.Net.Sock ets.Socket.Conn ect(EndPoint remoteEP)
>
> pls help me its urgent
>
> if any socket api in c#.net then pls give me link or details abt that
>
> Thanx & Regards....
>
> --
> Ather Murtuzapurwala
> Software Engineer
> Mumbai,India
>
> A man of trial is a man of success
>


Nov 16 '05 #6

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

Similar topics

1
6339
by: pyguy2 | last post by:
Issues of socket programming can be wierd, so I'm looking for some comments. In my python books I find exclusive use of socket.close(). From my other readings, I know about a "partial close operation". So, I figured it would be useful to post some code about how socket.close() has an implicit send in it and you can actually gain some clarity by being more explicit with the partial close which means splitting socket.close() up into...
5
3679
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are too basic. My programming environment is Windows XP, Visual Studio .NET 2003 and C#. So here it...
1
3388
by: John Sheppard | last post by:
Thanks to everyone that responded to my previous Socket Programming question. Now I have run into some behavior that I don't quite understand. Programming environment. VS.NET 2003, C#, Windows XP. About the architecture: I have a socket server dll that contains a class that handles connections for a given local ipaddress and port. This class(server) can be started or stopped by calls to the appropriate functions. The server class has...
5
11697
by: mscirri | last post by:
The code below is what I am using to asynchronously get data from a PocketPC device. The data comes in fine in blocks of 1024 bytes but even when I send no data from the PocketPC constant blocks of 1024 with all values set to Null arrive. Other than examine a block of 1024 to see if the entire block is null, is there any other way to determine if , say a chat message "Hi Charlie" has been received completely?
2
15324
by: djc | last post by:
I read a network programming book (based on framework 1.1) which indicated that you should 'never' use the RecieveTimeout or the SendTimeout 'socket options' on TCP sockets or you may loose data. I now see the socket.RecieveTimeout 'property' in the visual studio 2005 help documentation (framework 2.0) and it has example of it being used with TCP socket. This propery is also listed as 'new in .net 2.0'. 1) is the socket.RecieveTimeout...
10
4024
by: Uma - Chellasoft | last post by:
Hai, I am new to VB.Net programming, directly doing socket programming. In C, I will be able to map the message arrived in a socket directly to a structure. Is this possible in VB.Net. Can anyone please help me with some sample codings and guidance? Can you also suggest some other news group available for socket programming in VB.Net?
11
8595
by: atlaste | last post by:
Hi, In an attempt to create a full-blown webcrawler I've found myself writing a wrapper around the Socket class in an attempt to make it completely async, supporting timeouts and some scheduling mechanisms. I use a non-blocking approach for this, using the call to 'poll' to support the async mechanism - rather than the 'begin' and 'end' functions. I already found that connecting doesn't set the "isconnected" variable correctly...
0
1897
by: shonen | last post by:
I'm currently attempting to connect to a shoutcast server pull down the information from here and then I'll parse it. I got this working with the httplib, which was great, the problem is I want to use the select statement to do only do this periodically. (I'm trying to be a client, accepting data, that might be my first problem) Basically this is the code that im working on to TEST to mimic what the httplib does, only return a socket...
8
4671
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site application in asp.net and code behind is Visual C#. In page_load event, I am using atl com component. Here one for loop is there. In this for loop, number of iterations are 1000, I can receive some data using com component. It is just set of some characters like
3
2764
by: Stuart | last post by:
I am in the process of teaching myself socket programming. I am "playing around" with some simple echo server-client programs for m the book TCP/IP Sockets in C. The Server program is: #include "TCPEchoServer.h" /* TCP echo server includes */ #include <pthread.h /* for POSIX threads */
0
8472
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
8909
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
8596
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
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
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...
0
5690
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4221
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...
0
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1801
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.