UDP using c# and .NET
From: sanjay (sanjay_at_discussions.microsoft.com)
Date: 12/29/04
- Next message: DP: "Bluetooth Discovery Timeout in Platform SDK for XP"
- Previous message: Eugene Gershnik: "Re: How to determine if IPv6 is installed (using VC++ 6.0)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 29 Dec 2004 10:33:07 -0800
I am building an app which send query to a remote machine and listens on a
port (8112) for response. I can send the data successfully but not able to
receive anything. I can see i am binding to the port corectly. Also now I am
geting this
invalid argument error for receive and also for receivefrom. Here is the code
Any help is appreciated.
first I am creating sockets
MDSSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp);
mdsendpoint = new IPEndPoint(IPAddress.Parse(MDSServerIP), MDSServerPort);
SSCEndpoint = new IPEndPoint(IPAddress.Any, StoreClientPort);
MDSServerSock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp);
MDSSocket.SendTo(buffer,mdsendpoint );
buffer = new byte[buffersize];
MDSServerSock.Bind(SSCEndpoint);
MDSServerSock.Receive(buffer,0,buffer.Length ,SocketFlags.None);
This is on a thread
thanks
sanjay
- Next message: DP: "Bluetooth Discovery Timeout in Platform SDK for XP"
- Previous message: Eugene Gershnik: "Re: How to determine if IPv6 is installed (using VC++ 6.0)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|