C# Socket Programming - Multiple Clients

Поделиться
HTML-код
  • Опубликовано: 9 фев 2025
  • This is the simplest way I could do it. Find the code here (it's a bit more organized):
    github.com/Abl...
    BTW: Use Buffer.BlockCopy() same syntax but faster

Комментарии • 277

  • @waszqba
    @waszqba 3 года назад +3

    Your source helped me a lot with my uni project, made me kinda understand how to use C# implementation of sockets and how to serialize data for that. Not all heroes wear capes, thank you.

  • @fletchercutting9440
    @fletchercutting9440 9 лет назад +5

    Thanks for the awesome tutorial. I'm currently designing a multiplayer hacking simulator which I will now be able to program thanks to this tutorial :) It's basically just going to be command based where the client types in commands and the commands, clients and other data is dealt with in the server. Thanks a heap :D

  • @fanuelinawgaw2065
    @fanuelinawgaw2065 9 лет назад

    That was awesome! Not only did you help me get a better understanding but you also made me go further, so thank you very much!

  • @tgifhounds
    @tgifhounds 10 лет назад +3

    You are one of those guys people stand behind and watch code, great tutorial.

  • @harunmn
    @harunmn 7 лет назад

    i was trying to learn about socket programming and this video is awesome, just watched once then i wrote my own server and client.
    thanks for sharing....

  • @b4ux1t3-tech
    @b4ux1t3-tech 10 лет назад +1

    Excellent job teaching Sockets. Though, I would have preferred if you took time to comment your code. Not because it necessarily needs comments (though they might help explain things a bit better) but more because otherwise you go very fast! I had to pause and go back several times.
    Still, learned more about working with sockets tonight than I ever did trying to read the docs.

    • @LeftTechticle
      @LeftTechticle  10 лет назад

      Indeed, I am going to get around to the source and apply comments to it at least. I've been refactoring everything.

  • @squirekev
    @squirekev 4 года назад

    4:30am testing, ah the exciting life of a programmer. few minutes off from when I'm watching to attempt a similar objective.
    Nice tutorial. Verbalizing as you worked away was very helpful in understanding the reasoning for your choices.

  • @alessandrogerelli
    @alessandrogerelli 7 лет назад +3

    Great job. You just saved my life and teaches me something fantastic.

  • @stefdevs
    @stefdevs 5 лет назад

    Oh thank god. This is so much nicer than the TcpListener/TcpClient api, which is all I've seen in google results. I've been using sockets directly like this for Udp traffic but wasn't sure that I could do the same for Tcp.

  • @dmccalldds
    @dmccalldds 4 года назад +1

    How did you add a second Client at 26:30?

  • @Krypton91
    @Krypton91 4 года назад +1

    Thank you for this Tutorial! Very usefull to understand how sockets work in C# :)

  • @randomasshandle223
    @randomasshandle223 11 лет назад +1

    Thanks a lot dude! Very easy to follow along, you spoke clearly, and explained what each method did.
    A++ would recommend.

  • @tahacyberman3640
    @tahacyberman3640 10 лет назад +1

    THAT was AWESOME (Y) really thank you man, you are very pro brother, thank you , that was what I was searching for it for about 2 weeks (Y) THANK YOU

  • @panagiotisgnafakis9851
    @panagiotisgnafakis9851 10 лет назад +11

    Hey man, your tutorial is awesome and I did understand it.
    I have one problem though, if I try to send data from another computer in the network it doesn't work. I try to change the listening IP to a specific IP and it only accepts connections that come from my computer's IP. If I try to send anything through the network, i.e. from another computer either
    A) it does't see the data coming (when socket is bound to "IPAddress.Any")
    B) it crashes at server setup (when socket is bound to an external (LAN address))
    Do you have any idea on what is wrong?

  • @ajitkumar15
    @ajitkumar15 10 лет назад

    Great Video.. you are a great programmer .I am big FAN of yours. Thanks for this video...it helped me to understand our company project which is also using socket programming.

  • @fletchercutting9440
    @fletchercutting9440 9 лет назад +14

    If you want to fix the error when the client disconnects, replace the code in the ReceiveCallback function with this:
    Socket socket = (Socket)ar.AsyncState;
    try
    {
    int received = socket.EndReceive(AR);
    byte[] dataBuf = new byte[received];
    Array.Copy(_buffer, dataBuf, received);
    string text = Encoding.ASCII.GetString(dataBuf);
    Console.WriteLine("Text received: " + text);
    if (text.ToLower() == "get time")
    {
    SendData(DateTime.Now.ToString(), socket);
    }
    else
    {
    SendData("invalid request", socket);
    }
    }
    catch
    {
    Console.WriteLine("client disconnected");
    socket.Close();
    socket.Dispose();
    }

    • @bigbolo1986
      @bigbolo1986 9 лет назад

      thanks for this!!!

    • @firstnamelastname7844
      @firstnamelastname7844 7 лет назад

      What's the SendData function?

    • @SuperChristianMiiworld
      @SuperChristianMiiworld 7 лет назад

      Where the f**k did that SendData function come from?

    • @diogocgi
      @diogocgi 7 лет назад

      tank you ^^

    • @lucasgrizante1165
      @lucasgrizante1165 6 лет назад

      If a client disconnect, should I remove him from _clientSockets list?
      also, if I'm creating a game (just for example) with a login screen and etc, I'd have to call the "loopconnect" at the login button?
      Also, how can I force a client to disconnect (and make him know that he has been disconnected)? I'm thinking about just calling something like _clientSockets[0].Close(), _clientSockets[0].Dispose(), _clientSockets.remove(0); but I don't know what would happen with the client at this point.
      Also, thanks for your fix!!

  • @usergroupX
    @usergroupX 10 лет назад +52

    ah , no need to convert port's byte ordering like in c++ ...you know why I don't neeed glasses? because I can C # .. lol

    • @tyrellwreleck4226
      @tyrellwreleck4226 7 лет назад +4

      i have no idea what you said about c++, im no c++ literate but i like your joke :)

    • @Chiramisudo
      @Chiramisudo 6 лет назад +5

      Wait, does that mean I can't C# because I do need glasses?... but I can C#. It's a paradox!

    • @mreazl6227
      @mreazl6227 4 года назад

      Lmao

  • @nealdorelis5703
    @nealdorelis5703 2 года назад

    Nice! Can you connect this short client/server app with a database ??

  • @martinhschei6486
    @martinhschei6486 7 лет назад +1

    Nice tutorial! But why make the buffer static? All recevied data from clients will then be put in the same buffer.

  • @nimda4047
    @nimda4047 3 года назад

    Nice video, now the following question occurs to me; if i want to send a message from one client to the other(s) via server (client1 -> server -> client2), do i just use a loop and count through all the connected client sockets like "clientSockets[i].Send(data); i++;"

  • @justchris846
    @justchris846 6 лет назад

    if the ports specified in code don't work, then set the port's number higher than 1024, I forget if port 100 is used by the system or not, but there are a LOT of open ports available, excellent tutorial tho!

  • @NotNazuh
    @NotNazuh 3 года назад

    It works great but if I exit out of my client it causes errors in my server and shuts it down.

  • @stutitehri993
    @stutitehri993 10 лет назад

    superb tutorial;used to be scared abt socket programming

  • @theldentity
    @theldentity 7 лет назад

    My visual studio says that Socket does not contain definition for BeginAccept help please. Tried in windows forms and actually works

  • @Mabox-sc5iz
    @Mabox-sc5iz 2 года назад

    I don't know if you don't pay attention but is there something for when a socket is disconnected?
    Because when I close a client the server crashes

  • @DaminGamerMC
    @DaminGamerMC 3 года назад

    what resources could I use to learn about programming stuff like this?

  • @LeftTechticle
    @LeftTechticle  11 лет назад +1

    Ya, if your clients disconnect ungracefully, you can get exception in various points of the server. You need to handle these errors and remove the client form your client list when they occur for a specific client.

  • @JMemini8
    @JMemini8 10 лет назад

    Great Tut. I Learned something. But sir, why my client side only can request one time only? an also I tried with my two laptops connected to one router but the client cannot connect to server? Please response as soon as you got time. Thanks

  • @luispinto8308
    @luispinto8308 3 года назад

    Hello, when the client socket is disconnected, the socket server is also closed, is the process normal?
    I needed the server to stay alive.
    Can you help?

  • @newbienewbie4823
    @newbienewbie4823 9 лет назад

    i get this error for int received = socket.EndReceive(AR);
    unhandled exception: system.nullreferenceexception:object reference not set to an instance of an object.

  • @wilsonangga
    @wilsonangga 3 года назад

    can we make send data from server to client ? even before server receive data from client?

  • @LeftTechticle
    @LeftTechticle  11 лет назад

    Well the Speech namespace does not provide freeform dictation, but you can try to load an entire English dictionary as grammar. You would then perform tests on the results like anything else. This is a long shot though

  • @varunjain0606
    @varunjain0606 9 лет назад

    Hi,
    Nice tutorial. Learned a lot from the video.
    However I have a doubt as to how can we handle the request based on timer...means I want to disconnect the socket connection if i don't get response from any client. May be 5 seconds for instance and the time for each client starts from the moment they are connected and whenever they send response, the particular timer for the client resets to 5 secs.
    Thanks.

  • @dorinelnicolaerus3533
    @dorinelnicolaerus3533 11 лет назад

    The idea is that the boards read some sensors, after that the data is processed by the firmware within the micro-controller and than is sent using Ethernet protocol to the server. Another situation is when I send from the server a command and the firmware within the micro-controller will process it and do a different task. So my question is whether the video that you presented can be adapted to do this, because I think that I must to use the same Socket class.

  • @tomasmartins5009
    @tomasmartins5009 8 лет назад +1

    How would you go about checking everyone who's connected to the server and sending messages from the server to any client at any given time, not just as a response to a request from a client. Sort of a push notification.

  • @jayelliott1
    @jayelliott1 7 лет назад

    Hello Brian. I'm interested in executing OS commands on multiple servers in parallel ..ie to stop and start applications on all servers at once. I'm using VS Studio WPF C#...also considering integrating python or windows powershell, but hope to use C# only...do you have any tips? Will the method of programming sockets in your video work? I'm new...please share tips?

  • @norge_daniel
    @norge_daniel 5 лет назад

    Hi Brian. Congratulations.Good tutorial !! Do you have some example from this point to implement WebSocket Server in C# using Socket ?

  • @keithhutchy1990
    @keithhutchy1990 7 лет назад

    I dont know what I have done wrong but the server is just saying the exact same thing I say so if I say get time it says received get time but on the server console it shows i am connected and shows what I said its as if the client is just printing what I am typing instead of the server response or its as if the server is just sending the same data back I have watched this video more than 10 times and our code matches is this a problem with visual studio 2017

  • @AcEPFL
    @AcEPFL 11 лет назад

    In order to stop it closing you have to add Console.Readline(); in the Main. Make sure it is your last code in the Main.

  • @MrHogarth45
    @MrHogarth45 11 лет назад

    Hey thanks for the video, I've just decided to get into network programming and this is a great introduction.

  • @manalishah23
    @manalishah23 11 лет назад

    hey .. great video .
    concepts still a bit unclear .
    can u tell where exactly a new thread is spawn and when socket.close is called whether in client or server code then what exactly should happen in terms of where the program control get transfered.
    thanks

  • @LeftTechticle
    @LeftTechticle  11 лет назад +1

    Are you looking for suggestions on creating a chat program?

  • @retro2712
    @retro2712 4 года назад

    Hey im unsure if you still do tutorials but can you please make another video just like this but goign mroe in depth

  • @ninjasquidface
    @ninjasquidface 10 лет назад

    How come mine stops receiving from a client when the receive callback is called? I mean to say it only works if I put the beginreceive command at the end of the receive callback, is this normal?

  • @bulldoggin12
    @bulldoggin12 11 лет назад

    I am as I'm working in a group on a chat program with a GUI built using WPF in Visual Studio. I take no part in creating the GUI, but only the server. I have worked with very simple servers before, but I am seeking advice on how to go about this. The most important thing is to be able to receive and store information, I would imagine writing to a text file, but I am hesitant.

  • @sbasalan
    @sbasalan 11 лет назад

    How about out of loopback IP usage of your project? Because I did a project but it can only run as loopback IP(127.0.0.1)

  • @rogernevez5187
    @rogernevez5187 9 лет назад

    Excellent! Do you know if it is possible to do a raw socket in win7?

  • @lania4334
    @lania4334 4 года назад

    For socket which the best C or C#? Or any language

  • @DaGoofSta
    @DaGoofSta 7 лет назад

    Everyone who wants to send the time to all clients at once you would need to loop through the socket list sending it to all at once for instance
    List socketList = new List();//Will be full of connected clients
    foreach(Socket s in socketList)
    {
    byte[] data = sendString("time string here");
    s.Send(data);
    }
    public byte[] sendString(string msg)//method for converting bytes into strings
    {
    byte[] data = Encoding.ASCII.GetBytes(msg);
    return data;
    }

  • @LeftTechticle
    @LeftTechticle  12 лет назад

    Its in my best interest to disregard byte accumulation for this video. And I dont know what you mean with the callbacks. And by the way, I will have another vid on receive past buffer size which will be much more robust than the other one.

  • @siavashmehmandoost2198
    @siavashmehmandoost2198 4 года назад

    Thanks for this amazing tutorial! Is this applicable on Unity? I set client code on unity, But when I ran server on pc it didn't work

  • @Mystic0Dreamer
    @Mystic0Dreamer 7 лет назад

    This works fine when I run the client and server on the same computer. But when I run them on two different computers they never connect. These are computers that are connected via WiFi in my home and can share files. So why isn't this working? Do I need to specify IP addresses?

  • @RMDetho
    @RMDetho 8 лет назад

    Greetings @LeftTechticle , I liked your video and I liked your example even more. I hope you don't mind me asking you this.. I'm working on a multiplayer card game (just to learn, no specific reasons) and I stumbled upon your video trying to find a solution to server/client connections. In your example, the client is just as is on the server, in other words, server doesn't care who the client is.. but is there a way to differentiate separate clients? or send sort of an object containing information about the specific client to the server?

  • @tyrellwreleck4226
    @tyrellwreleck4226 7 лет назад

    why didn't you make a separate class for the client? just wondering

  • @scastetter
    @scastetter 11 лет назад

    Can make the code for your Socket programming example available on your link you provided...I was not able to find it. Great job on the example.

  • @kimy5480
    @kimy5480 7 лет назад

    Hello! How can I allow connections from clients outside of my local network?

  • @ErdincCevlan
    @ErdincCevlan 5 лет назад

    Thanks for tutorial, it's awsome. But i am trying to figure out how can i make multiple connections for the basicasyncserver and basicasyncclient? how can i turn them into accpet multiple connections?

  • @AbbasKhan-qu7ib
    @AbbasKhan-qu7ib 7 лет назад +2

    i have done the same code and it worked fine. i made some changes like from server side i changed responce on switch(text) and it worked well
    but when i tried to read() some responce from serverside, on run time it throws exception of socket ,
    at int rec = _clientSocket.Receive(recievedBuf);
    if someone can help ???

  • @jubin4joy
    @jubin4joy 11 лет назад

    Thanks a lot dude, it was something new from my experiance.

  • @WelshGuitarDude
    @WelshGuitarDude 7 лет назад

    Would this stuff be used to make server FPS stuff or is this more for things that doesn't require fast updates?

  • @3fr0sty47
    @3fr0sty47 10 лет назад

    Error 1 The type or namespace name 'IPEndPoint' could not be found (are you missing a using directive or an assembly reference?)

    • @cvigu
      @cvigu 10 лет назад +1

      using System.Net;
      using System.Net.Sockets;

    • @INeedAttentionEXE
      @INeedAttentionEXE 9 лет назад

      +Madarász Bence Add using System.Net; and using System.Net.Sockets; to the top of the file at the namespaces

  • @gottogetbig2900
    @gottogetbig2900 8 лет назад

    What does the buffer do? What happens if you dont use a buffer?

  • @ThePreceptIsInCSharp
    @ThePreceptIsInCSharp 7 лет назад

    can it work like a public server I meant can it send a message to one computer from a remote computer?

  • @JoMo93
    @JoMo93 7 лет назад

    Did anybody get a NullReferenceException for "int received = socket.EndReceive(AR);" when putting in a request? It gave an error and shut down the server.

  • @agustawicaksono
    @agustawicaksono 9 лет назад

    I tried this code, and it works...
    but somehow. the server stops listening and i got this.
    "The thread '' (0x1768) has exited with code 0 (0x0)."
    Any helps?

  • @HonnerApl
    @HonnerApl 7 лет назад

    I have a doubt, running this with many clients, using the same static buffer won't make the requests get all mixed?

  • @FranciscoJBurtin
    @FranciscoJBurtin 6 лет назад

    Hi, Why you didn't develop you server in WCF fullduplex service?

  • @МаксимАбрамов-т7м
    @МаксимАбрамов-т7м 6 лет назад

    Hi,Dude! Can I create a class based on your method? I asking, because you use static fields...

  • @JesusChrist-tt1sz
    @JesusChrist-tt1sz 9 лет назад

    If you want to get rid of the error that occurs when the client gets closed you need to use a try catch around where you get the exception.

    • @LeftTechticle
      @LeftTechticle  9 лет назад +1

      Jesus Christ Ye, gotta catch them all

  • @LeftTechticle
    @LeftTechticle  11 лет назад

    Its probably not a good idea to try to predict where threads are spawned in Async methods. Just know whether you on a UI thread or not (print out your current thread IDs or something to see). BTW this vid is not meant to explain the behavior of anything, it was just to present a simple design pattern for multiple clients.

  • @bulldoggin12
    @bulldoggin12 11 лет назад

    I need to construct a server which can receive/store the information in a "friends list" from a client for a chat program. Do you have any suggestions?

  • @krisztiangancs8432
    @krisztiangancs8432 10 лет назад

    Nice tutorial. How can I safely close a socket from client side? Cause' when a client exit the server crash and if not crash (the server not crash every time) and I restart the client server not answer the requests.

    • @srheal07
      @srheal07 10 лет назад

      all you have to do is use a
      try
      {
      Put the procedure of code that errors it will fix when the client disconnects
      }
      catch(SocketException)
      {
      Console.WriteLine("Client Disconnected")
      }

  • @waffleman4503
    @waffleman4503 4 года назад

    Does anybody know how to use this to connect two computers that aren't connected to the same router? (IE, in the same house.) I've never done any network programming or socket programming before.

    • @hansbyager5795
      @hansbyager5795 4 года назад

      you need the IP's then the port number

    • @farhanhakim2189
      @farhanhakim2189 3 года назад

      Try put IPAddress.Parse then pass the IP string instead of IPAddress.LoopBack

  • @manalishah23
    @manalishah23 11 лет назад

    hey if the client sends a msg end then the server closes that particular socket. but if i close my client console window then my server crashes. can u suggest how to resolve if the client closes the console window or stops running its program then the server must still remain on .
    thanks :)

  • @zoeyan7225
    @zoeyan7225 8 лет назад

    Hi sir, I have two stepper motors connected to my PC using Ethernet cable, is your code able to realize the communication between PC and stepper motor? for example I could send command from clientSide and get response from server side? thank you

    • @LeftTechticle
      @LeftTechticle  8 лет назад

      I have no way of determining this. Assuming you are connecting to a microboard with compact .net framwork, and all of the references can be resolved, then the code will run fine. Other than that, you should check the CLS compliance of code before installing it on a microboard.

  • @cristianokwiatkovsk9059
    @cristianokwiatkovsk9059 4 года назад

    very good job, i used this in my study

  • @mjordz4138
    @mjordz4138 4 года назад

    when a clients leaves the server crashes. Have i missed something ?

  • @TuNguyen-zw9dv
    @TuNguyen-zw9dv 11 лет назад

    could you please send me the code of these solutions? i can't find them in your attached link. thanks a lot

  • @lappn99
    @lappn99 7 лет назад

    How would I send the data to multiple clients?

  • @standinonstilts
    @standinonstilts 10 лет назад

    How would you send data to all clients on a list of sockets?

    • @DukeLaze
      @DukeLaze 9 лет назад

      standinonstilts for each (Socket sock in _clientSockets) {
      sock.write/beginwrite
      }
      _clientSockets is the list.
      Something like that ^^

  • @yothri880
    @yothri880 10 лет назад

    How to detect now if a client disconnects properly?! I could send a 'left' message but if i kill the process of the client for example in task manager... how to let the server detect the disconnect of the client

    • @kennei1988
      @kennei1988 10 лет назад

      try a simple try-catch on the connection, that should do it.

  • @jeelpatel9818
    @jeelpatel9818 5 лет назад

    thank you very much. Really nice explanation

  • @LeftTechticle
    @LeftTechticle  11 лет назад

    You mean the first letter? Because if I did that it would be akward considering all methods in the framework use PascalCase, plus 97% of 3rd party C# methods.

  • @sangvu6255
    @sangvu6255 8 лет назад

    I have a problem, i open 1 port at My Router, I sent to my friend IP Router and this Port.
    My friend can chat with me by using Socket Chat Application, I also chat with myselft by using this.
    But 1 program like as Skype or web as facebook not only don't need open a port, but also message is sent. I don't know how I do it?
    Hope you give me more inforamation usefully, thanks

    • @LeftTechticle
      @LeftTechticle  8 лет назад +1

      Everything you need to know is on this SO post or linked in this SO post regarding Skype's methodologies:
      stackoverflow.com/questions/1539339/how-does-skype-work-without-port-forwarding
      You can also create dedicated servers and relay everything through them (clients don't need to port forward, only the servers).

  • @dorinelnicolaerus3533
    @dorinelnicolaerus3533 11 лет назад

    Nice video. I want to create a server that send commands to 50 electronics boards, and receive information from that boards. All boards have a micro-controller with Ethernet integrated. Could you show me how I can communicate with this boards?

  • @jonaskorte6873
    @jonaskorte6873 7 лет назад

    Are the callbacks for send and receive for receiving and sending from one of the clients or for the server?

    • @jonaskorte6873
      @jonaskorte6873 7 лет назад

      Oh, already understand, I don't need any help i think!! Keep up the good work bro!

  • @thegrumpysock6391
    @thegrumpysock6391 9 лет назад

    I get a nullreferenceexception when I do the time command

  • @superpcstation
    @superpcstation 11 лет назад

    can you suggest a good book that is up to date?

  • @carloslorenzo7104
    @carloslorenzo7104 9 лет назад

    as I can make one client message is sent to the server and the server will send that message to the client 2 ? thanks , PS: I've been with your video from multiple clients, but I need him as a server that can transmit the message from the client 1 to client 2

    • @INeedAttentionEXE
      @INeedAttentionEXE 9 лет назад

      +Carlos Lorenzo You will have to send the data to the server then have the server relay it to the other client.

    • @jonaskorte6873
      @jonaskorte6873 7 лет назад

      That's the almost exactly the same sentence xD! Can you explain it a little bit better, i need something for that to!

  • @Player-ub9tg
    @Player-ub9tg 4 года назад

    How to make that server remote?

  • @LeftTechticle
    @LeftTechticle  11 лет назад

    I think using the Socket class would be the best. Theres abstractions like TcpClient and TcpListener that don't seem to make anything easier. I cant tell you if it would be appropriate to adapt the sample. The sample wont be able to retrieve large amounts of data. As well its better just to put all of this stuff in a class library if it were any more complex than this.

  • @ati2636
    @ati2636 8 лет назад

    if the client lose the connection with the server how can I reconnect to there. Because I tried to turn back the to the loopback(); but it is not connecting back.

    • @sanganagoudbiradar9677
      @sanganagoudbiradar9677 8 лет назад

      have you got answer for your question i need the same answer for the same

  • @LeftTechticle
    @LeftTechticle  11 лет назад

    I can help with specific things for sure, but if your boards do not run .NET, then I would have little idea how to process the request.

  • @btd5mariomusiccube
    @btd5mariomusiccube 8 лет назад

    There's an access violation exception when the server sends the time to the second (or third or fourth etc.) clients. The first client that connects works perfectly fine though. Also I did not modify any of the downloaded files.

    • @LeftTechticle
      @LeftTechticle  8 лет назад

      That totally sounds like a firewall thing.

  • @zeekloft
    @zeekloft 11 лет назад

    Normally people use PascalCase for methods but camelCase for variables and such.

  • @manalishah23
    @manalishah23 11 лет назад

    hey ,
    if i disconnect one of the clients then the server also shuts. how to resolve that ?

  • @LeftTechticle
    @LeftTechticle  12 лет назад +4

    I know exactly what you mean, but I left them things out for the sake of the concept

  • @3adelmer3e
    @3adelmer3e 8 лет назад

    hi I got this exception
    The IAsyncResult object was not returned from the corresponding asynchronous method on this class.
    and it is under the
    private static void AcceptCallback(IAsyncResult result)
    on the line
    Socket socket = ServerSocket.EndAccept(aresult);
    please take look at this link
    stackoverflow.com/questions/31139784/the-iasyncresult-object-was-not-returned-from-the-corresponding-asynchronous-met
    I could find the problem.
    thanks

  • @scriptspyofficial8497
    @scriptspyofficial8497 10 лет назад

    to make this work through an external ip. The external ip needs to be static and the port you used needs to be port forwarded. if the ip is not static then whenever your network changes you will need to change the client ip to your new ip

    • @scriptspyofficial8497
      @scriptspyofficial8497 10 лет назад

      also when setting up the connection to the server instead of using (IPAddress.Any , "porthere") you would use (IPAddress.Parse(IPHere), "Port here")

    • @maxchehab6145
      @maxchehab6145 9 лет назад

      ScriptSpyOfficial Hmm, this doesn't seem to work. Do you mean to use an ip address from www.whatsmyip.org/ ? In order to have a static IP, I am pretty sure you need to own that IP (through a website). I may be wrong about that however.

  • @jonaskorte6873
    @jonaskorte6873 7 лет назад

    How can i recieve data from a client and send it to another client so that client can do something with it?