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

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.Sockets.SocketException: No connection could be made because the
targ
et machine actively refused it
at System.Net.Sockets.Socket.Connect(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 4665
Hi,

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

In .NET you use the System.Net.Sockets 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

"AtherMurtuzapurwala" <At*****************@discussions.microsoft.com> wrote
in message news:7B**********************************@microsof t.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.Sockets.SocketException: No connection could be made because
the
targ
et machine actively refused it
at System.Net.Sockets.Socket.Connect(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.com

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

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

In .NET you use the System.Net.Sockets 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

"AtherMurtuzapurwala" <At*****************@discussions.microsoft.com>
wrote in message
news:7B**********************************@microsof t.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.Sockets.SocketException: No connection could be made because
the
targ
et machine actively refused it
at System.Net.Sockets.Socket.Connect(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

"AtherMurtuzapurwala" <At*****************@discussions.microsoft.com> wrote
in message news:7B**********************************@microsof t.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.Sockets.SocketException: No connection could be made because
the
targ
et machine actively refused it
at System.Net.Sockets.Socket.Connect(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

"AtherMurtuzapurwala" <At*****************@discussions.microsoft.com> wrote
in message news:7B**********************************@microsof t.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.Sockets.SocketException: No connection could be made because
the
targ
et machine actively refused it
at System.Net.Sockets.Socket.Connect(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***@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.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

"AtherMurtuzapurwala" <At*****************@discussions.microsoft.com>
wrote
in message news:7B**********************************@microsof t.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.Sockets.SocketException: No connection could be made because
> the
> targ
> et machine actively refused it
> at System.Net.Sockets.Socket.Connect(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
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...
5
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...
1
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...
5
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...
2
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...
10
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...
11
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...
0
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...
8
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...
3
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: ...
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: 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
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...
0
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,...
0
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...
0
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,...
0
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...

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.