PC Review


Reply
Thread Tools Rate Thread

Cannot receive data sent across socket connection by .NET app

 
 
=?Utf-8?B?U3VidSBBbmFudGhhcmFt?=
Guest
Posts: n/a
 
      2nd Sep 2005
I have a .NET app that connects to a third-party server on a socket and sends
data. This works with a test server on the local network, but does not work
across the frame connection to the third-party server. They see a connection,
but never see any data coming across.
This works with Win32 app using winsock.
However, if I use [DllImport] and call a Win32 dll that uses Winsock from my
..NET app, it does not work.
Is there some setting in .NET framework security or my code that I am missing?
Any ideas?

Thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3VidSBBbmFudGhhcmFt?=
Guest
Posts: n/a
 
      6th Sep 2005
Here's the code from the client side. The server is a third party app and it
sees a connection, but never sees any data coming through. From a pure Win32
app, the third party app is able to see the data. I have tested this locally
using a test server and the data goes through fine.
----------------
IPAddress ipAddress = IPAddress.Parse(host);
IPEndPoint ipe = new IPEndPoint(ipAddress,port);
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
socket.Connect(ipe);
String msgtxt = "Hello";
byte[] msg = Encoding.ASCII.GetBytes(msgtxt);
int bytesSent = 0;
bytesSent = sk.Send(msg,SocketFlags.DontRoute);
sk.Shutdown(SocketShutdown.Both);
sk.Close();
-------------------

Thanks
Subu

"Hasan O" wrote:

> Hi ,
> search for my old questions about socket s and show us your code , maybe i
> can help you


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to receive data from .NET socket into VB6 winsock ? cadriansyah@gmail.com Microsoft VB .NET 2 8th Sep 2006 07:17 AM
Re: Cannot receive data across socket connection by .NET app Mike Blake-Knox Microsoft Dot NET Framework 1 6th Sep 2005 03:32 PM
Socket.Receive Issue - not returning all data TacoGod Microsoft VB .NET 3 18th Mar 2005 02:50 PM
strange problems with Socket.Send/Socket.Receive Amadej Microsoft C# .NET 1 9th Aug 2004 12:01 PM
Send/Receive XML Data as Byte[] through socket between java,C# pei_world Microsoft C# .NET 0 21st Mar 2004 06:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:27 PM.