witam,
sprawa wyglada tak, jest sobie program klient, ktory do programu serwer poprzez UDP wysyla kilka cyferek, program serwer zwraca liczbe typu float.
Mam problem z jej wyswietleniem. Prosze o szybka pomoc.
Program klient:
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace suck
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int[]tab = {5,4,2,9,15,17,1,8};
int j=0;
byte[]liczba = new byte[tab.Length*4];
for (int i=0; i<8; j+=4, i++)
{
byte[]dane = BitConverter.GetBytes(tab[i]);
dane.CopyTo(liczba,j);
Console.WriteLine(tab[i]);
Console.WriteLine(liczba[i]);
}
UdpClient remotePC = new UdpClient("localhost",23);
remotePC.Send(liczba,liczba.Length);
UdpClient client = new UdpClient("localhost",0);
IPEndPoint ep = new IPEndPoint(IPAddress.Any,0);
byte[] data = remotePC.Receive(ref ep);
//tutaj dalej nie wiem jak to zrobic bo nic nie chce wyjsc!!!
}
}
}