문제

I've a code that send messages between server and client via 'WLAN', I am trying to send files between server and client (large files) wireless.Tried some codes

this code send messages

  ` string msg = richTextTxMessage.Text;
    NetworkStream networkStream = new NetworkStream(m_clientSocket);
    System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(networkStream);
    streamWriter.WriteLine(msg);streamWriter.Flush();
            ` 

       this code am trying to send files 
            byte[] byData = System.Text.Encoding.ASCII.GetBytes(objData.ToString ());
            if(m_clientSocket != null){
                m_clientSocket.Send (byData);
            }`

올바른 솔루션이 없습니다

다른 팁

Make sure your LAN/WLAN and WiFi networks have the same level of permissions/connectivity. Often, administrators reduce access rights for WiFi networks (as they're less secure). For example, it may be necessary to setup extra VPN connection before you can access something in your LAN. So

  1. Contact your system administrators about the differences and gotchas
  2. Grab the traffic with help of WireShark or similar sniffer and compare both cases (LAN/WLAN and WiFi)

read your file into a byte array and send it for example: byte[] data = File.ReadAllBytes("file"); m_clientSocket.Send (data);

byte[] data = File.ReadAllBytes("Reallybigfile.avi");
socket.Send(data);

socket will have to be created, your gonna have to google that yourself

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top