Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Socket problem in 2008

Status
Not open for further replies.

paulyc

Programmer
May 13, 2003
4
0
0
US
Hello,

I am attempting to write a socket program, in C#.
I am able to creat the socket, and use Ethereal to view the Tx and the Rx from the target. Ethereal reports Rx data, but I am unable to see any.

The highlights are as follows:

Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); //ok
s.Connect(IPs[0], port); //ok
endpoint = new IPEndPoint(IPAddress.Parse(host), port);
s.Bind(endpoint); //ok
s.SendTo(send_bytes, Tx_Length, SocketFlags.None, endpoint);

//ethereal reports tx and rx bytes!

//the following reports no data (exception generated)
new_socket.Receive(Rx_Packets, Rx_Packets.Length, 0);

//I also tried a thread that catches everything
int test = 0;
do
{
test = global_socket.Available;


} while (test < 1);

if (test > 0)
global_socket.Receive(Rx_Packets_Thread, Rx_Packets_Thread.Length, 0);

//no data

Any thoughts?



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top