C# Tutorial - TCP/IP Client Server | FoxLearn

  Рет қаралды 400,973

Fox Learn

Fox Learn

Күн бұрын

Пікірлер: 550
@frankfahrenheit9537
@frankfahrenheit9537 6 жыл бұрын
Nicely quick. Normally poeple take 10min just to explain how to place a button.
@Bobany
@Bobany 5 жыл бұрын
Now there's several ways to place a button, I'm just going to do it like this. But you can also go in here...
@alexkay9832
@alexkay9832 7 жыл бұрын
Everything in the code is right except the client btnConnect part where he didn't connect the client to server - private void btnConnect_Click(object sender, EventArgs e) { btnConnect.Enabled = false; System.Net.IPAddress ip = System.Net.IPAddress.Parse(txtHost.Text); client.Connect(txtHost.Text, Convert.ToInt32(txtPort.Text)); } add this part to client and it should resolve the problem
@jesoleil4634
@jesoleil4634 3 жыл бұрын
Thank uuuu u are great
@mekabugohan4373
@mekabugohan4373 2 жыл бұрын
nice
@cmoslee
@cmoslee 2 жыл бұрын
thank you for your advice!!
@SyedDanishTech
@SyedDanishTech 2 жыл бұрын
kindly tell me why this is show at the end [] . i think this is garbage value. how to remove this [].
@pontusbergstrom6520
@pontusbergstrom6520 Жыл бұрын
Thanks!
@TheFuture36520
@TheFuture36520 2 жыл бұрын
I love your sweet voice mummy. Thanks for the good use of the TCP/IP. Good old packets.
@thomasedwardking7286
@thomasedwardking7286 Жыл бұрын
Great video. Once again I got a lot out of it and especially from those commenting on it. Thanks for all the awesome work you do!
@Andrew-xb8hl
@Andrew-xb8hl 8 жыл бұрын
Thank you Fox learn for another great video we can learn C# coding from
@foxlearn
@foxlearn 8 жыл бұрын
Thank you so much
@kb_verruckt2735
@kb_verruckt2735 4 жыл бұрын
SimpleTcpServer is not found and ServerData_Received isn't in any context so the autocreation at 5:14 doesn't happen. Help? Edit: I figured it out. Incase anyone else struggled with this here: SimpleTcpServer only works when you use the suggested shortcut with the weird symbol next to it. ServerData_Received is when you type server. (then take the shortcut suggestion) DataReceived then directly next to it type += AND don't press space! Instead PRESS TAB. Edit 2: So i finished everything and got some help from the comments with appearing the text, but afterwards a few seconds, it spams the message like crazy. "You said hi you said hi you said hi you said hi you said hi..." Anyone know what might be causing this?
@foxlearn
@foxlearn 4 жыл бұрын
You should install SimpleTCP from Nuget
@kb_verruckt2735
@kb_verruckt2735 4 жыл бұрын
@@foxlearn I did that. Thanks! Do you know how to make message stop repeating after being sent?
@anandbhagat7860
@anandbhagat7860 2 жыл бұрын
i am stuck here because it is showing cs0103, does not exist for ServerData_Received, please reply asap
@manjeetnandal1
@manjeetnandal1 5 жыл бұрын
Your content & teaching pattern ia really awesome. We beginners salute you....
@foxlearn
@foxlearn 5 жыл бұрын
Thank you so much !
@Michu1234561
@Michu1234561 2 жыл бұрын
Thank you, amazing tutorial! It helps me a lot
@programmadore9588
@programmadore9588 4 жыл бұрын
10:08 ....whats that at the end of the message and how to remove it??? the special thing after "thank you for watching this video"
@foxlearn
@foxlearn 4 жыл бұрын
Updated
@phongnguyenkhac8474
@phongnguyenkhac8474 6 жыл бұрын
In Client Form, how can i know whenever client connected to server or fail?? Why didn't you creat a disconnect button for client??
@MobileGamingMK
@MobileGamingMK Жыл бұрын
very clean tutorial
@aecomplet
@aecomplet 7 жыл бұрын
Could you upload this project to the description?
@Repoone17
@Repoone17 7 жыл бұрын
i can not add the object "start" after on server.start what can ido do find it min 6:37
@maltewerner2482
@maltewerner2482 7 жыл бұрын
You have to import the libary
@kislez2013
@kislez2013 2 жыл бұрын
Thank you! Everything works, but I dont understand why client sends "\x13" at the end of the message box string?
@tibo6749
@tibo6749 Жыл бұрын
Probably something to do with the string formatting
@itsimsonbgandibul6926
@itsimsonbgandibul6926 2 жыл бұрын
"System.Exception: 'Cannot send data to a null TcpClient (check to see if Connect was called)'" it happens to me when I press "send' :(
@DierAllenChannel
@DierAllenChannel 2 жыл бұрын
You have to connect the client: client.Connect(txtHost.Text, Convert.ToInt32(txtPort.Text));
@guillaume8437
@guillaume8437 4 жыл бұрын
Hello Fox Learn, Thank you for this tutorial since it helped me a lot to my TCP project. Here's another question : How can we create the same kind of little program with 2 TCP ports? Thanks in advance.
@foxlearn
@foxlearn 4 жыл бұрын
Not clear your intention
@guillaume8437
@guillaume8437 4 жыл бұрын
@@foxlearn Sorry. Well, shorter, I want to receive messages from 2 external applications, one using TCP port 1111 and the other using TCP port 2222. Is there any way to create a single server that receives from multiple clients? Or 2 servers in the same program?
@omernoach7268
@omernoach7268 6 жыл бұрын
hay, can someone explain how to use other ip like if i want a friend to connect to my server how i do it? tnx (:
@kellykrakens
@kellykrakens 4 жыл бұрын
Answer please !
@cybershadoww9224
@cybershadoww9224 3 жыл бұрын
idk youre going to have to pay for a server. or setup some files for a server. and port forward
@kappaladi4229
@kappaladi4229 3 жыл бұрын
@@cybershadoww9224 what do you write in the files
@cybershadoww9224
@cybershadoww9224 3 жыл бұрын
@@kappaladi4229 Idk
@김안드레-i2f
@김안드레-i2f 2 жыл бұрын
하나만질문드려도될까요~ ip주소를 실제현재 제아이피주소로해야 서로작동이되나요?
@ivanmartinez3680
@ivanmartinez3680 7 жыл бұрын
System.Net.IPAddress ipaddress = System.Net.IPAddress.Parse("127.0.0.1"); SOLUTION
@henrywang9446
@henrywang9446 5 жыл бұрын
Can you tell me why this line is incorrect? System.Net.IPAddress ipaddress = new System.Net.IPAddress(long.Parse(txtHost.Text));
@PathsFinder3
@PathsFinder3 5 жыл бұрын
@@henrywang9446 I don't know why, but it's because of the "new". for some reason you don't need to create an instance =S
@user-ic1sh7wu8j
@user-ic1sh7wu8j 5 жыл бұрын
Thank you a Lot! This was needed!!!
@CelestialSoul
@CelestialSoul 7 жыл бұрын
Thanks for the video FoxLearn. Can I integrate this C# Client side script with the server written in C language (Using TCP) ? Please help me out.
@vikeshkumarmishra1981
@vikeshkumarmishra1981 6 жыл бұрын
System.Net.IPAddress iP = new System.Net.IPAddress(long.Parse(txtHost.Text));At this line I am getting error: Input string was not in a correct format.What is wrong with this?
@foxlearn
@foxlearn 6 жыл бұрын
Please check your ip address, then please try again. thank you !
@dakata2416
@dakata2416 5 жыл бұрын
@@foxlearn still dont work!
@Владимир_Великий_Русь
@Владимир_Великий_Русь 5 жыл бұрын
@@foxlearn Ты если выставляешь видео - то выставляй рабочий код а не хуйню которую нужно дорабатывать после тебя !
@phongthachtho9553
@phongthachtho9553 3 жыл бұрын
@@dakata2416 // chuyen string thanh dia chi ip var ip = IPAddress.Parse(txthost.Text.Trim()); if (ip.AddressFamily.ToString() == "InterNetwork") { var localIP = ip; server.Start(localIP, Convert.ToInt32(txtport.Text)); txtStatus.Text += "Server starting... "; }
@bishalpoudel3586
@bishalpoudel3586 3 жыл бұрын
@@phongthachtho9553 Hello Thank You So much , Could You mind assisting me please?, as I want to send and receive the data at every time, i.e real time data from one form to another . Please help Me !
@erickjoseruizpaz6227
@erickjoseruizpaz6227 5 жыл бұрын
That's amazing... Maybe, I was looking for something similar, I asked, I helped, but I needed to do a KDC, have not you made a video of that? Thank you.
@foxlearn
@foxlearn 5 жыл бұрын
Can you describe more details? thank you !
@doughknuts
@doughknuts 2 жыл бұрын
System.Net.IPAddress iP = new System.Net.IPAddress(long.Parse(txtHost.Text)); I get this error: System.FormatException: 'Input string was not in a correct format.' Any ideas?
@evidals
@evidals 8 ай бұрын
you should use: System.Net.IPAddress.Parse(tbHostIP.Text)
@guillaume8437
@guillaume8437 2 жыл бұрын
Hi! I have one (or more) external client(s). How could I use this SimpleTCP Nuget with multithreading? The messages are all received but they pile up in the buffers until the kernel accepts to read them and empty the buffer. I need to mention that these clients work correctly with Wireshark so I think it is not a matter of client but of threads of the server/listener. Could you share any example please?
@sanglelinh995
@sanglelinh995 7 жыл бұрын
Can you help me? When I click on Start button this code is not correct " System.Net.IPAddress ip = new System.Net.IPAddress(long.Parse(txtip.Text));" An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: Input string was not in a correct format. How I can fix it? Please!
@cloneyang0128
@cloneyang0128 7 жыл бұрын
Go back to check 9:17 and you will see the reason (code changed)
@icydeath11
@icydeath11 7 жыл бұрын
why does the code change tho? I have the same problem and mine isnt changing in half a frame like yours did.
@007smegol
@007smegol 7 жыл бұрын
I have the same problem. Has anyone been able to fix this?
@007smegol
@007smegol 7 жыл бұрын
Has anyone been able to fix this?
@angelmoroyoqui5265
@angelmoroyoqui5265 7 жыл бұрын
i use this: IPAddress ip = new IPAddress(BitConverter.GetBytes(BitConverter.ToInt32(IPAddress.Parse(txtHost.Text).GetAddressBytes(), 0))); but the program dont send the message :/
@minicikoyunda3630
@minicikoyunda3630 3 жыл бұрын
thank you Good Video
@foxlearn
@foxlearn 3 жыл бұрын
Thank you too
@zakariaannid4439
@zakariaannid4439 2 жыл бұрын
Hello Fox thanks for your efforts. I have a question. I want to get in my application the items connected to my laptop by the LAN RJ45 could this work, or do you have any good suggestions?
@Vietnamcamping89
@Vietnamcamping89 7 жыл бұрын
"server.Start(ip, Convert.ToInt32(txtPort.Text));" We got am error "Input string was not in a correct format" What happen :(?
@elementalwattson
@elementalwattson 6 жыл бұрын
you don't need to convert port value to int.
@muhammadaasimsoomro4971
@muhammadaasimsoomro4971 5 жыл бұрын
Here ist the missing code for "btnConnect_click": client.Connect(txtHost.Text, Convert.ToInt32(txtPort.Text));
@basemabdellatiff5213
@basemabdellatiff5213 4 жыл бұрын
IPAddress ip = IPAddress.Parse(HostTextBox.Text); // Using system.net
@kennethreytamis166
@kennethreytamis166 7 жыл бұрын
i have an error System.Exception: 'Cannot send data to a null TcpClient (check to see if Connect was called)' :( can you show me your codes? :( please
@HimBhavsar
@HimBhavsar 4 жыл бұрын
use client.Connect(txtHost.Text, Int32.Parse(txtPort.Text)); in Client Connect button Click Event
@coralch1
@coralch1 4 жыл бұрын
Very usefeul! Thanks for your work!
@omarmahmoudquraa161
@omarmahmoudquraa161 7 жыл бұрын
Can I use this example to connect between 2 laptops in public network ? or it works only in local network ?
@omarmahmoudquraa161
@omarmahmoudquraa161 7 жыл бұрын
and I need this source code please ( omarmahmoudquraa@gmail.com )
@dmitryvlasov931
@dmitryvlasov931 7 жыл бұрын
Yes, you can.
@foxlearn
@foxlearn 7 жыл бұрын
Sent. Thank you
@bmryner90
@bmryner90 7 жыл бұрын
may i have this source code as well. im working on an app for work that communicated with a video switcher using Telnet commands
@omarmahmoudquraa161
@omarmahmoudquraa161 7 жыл бұрын
Fox Learn sent it to me .. give me your mail I will sent it to you
@mertaksu6705
@mertaksu6705 5 жыл бұрын
thank you so much from Turkey
@foxlearn
@foxlearn 5 жыл бұрын
You're welcome. Thank you !
@Jemszie
@Jemszie 7 жыл бұрын
Thanks a lot Fox Learn. If I want get a IO using ethernet communication from Vision camera device, how can be done in C#. May I use the same concept as this tutorial? Seek your advice. Thank You
@foxlearn
@foxlearn 7 жыл бұрын
Yes, You can communication with your device via TCP/IP, Bluetooth . Thanks
@Jemszie
@Jemszie 7 жыл бұрын
Thank You.
@georgesalinas4349
@georgesalinas4349 7 жыл бұрын
Hi, is there any way to calculate the rate of the packets or bits being sent from client to server and display that on the interface? like packets/sec or Kbits/sec rate. thanks
@tonacody4100
@tonacody4100 6 жыл бұрын
How can i make a form with both function Send and Receive message, It is a server and a client both. I can run on any computer, input IP to send message, Can you give me some solutions or some demo xample. Many thank.
@davidreva1729
@davidreva1729 6 жыл бұрын
I want it too, please
@rootLocal10
@rootLocal10 5 жыл бұрын
use server.BroadcastLine
@otmanaboutaieb2273
@otmanaboutaieb2273 8 жыл бұрын
thank you so much ... It's very helpful
@foxlearn
@foxlearn 8 жыл бұрын
Thank you so much
@torzaa18
@torzaa18 7 жыл бұрын
But how would you send a Message to the client from the server? and have the client receive messages
@TREmreprogaming
@TREmreprogaming 7 жыл бұрын
OMG thanks god there was a russian guys and his video was 4parts x 10 mins and there was no exp.
@TREmreprogaming
@TREmreprogaming 4 жыл бұрын
@Philipp p how can i help you?
@kkss7092
@kkss7092 5 жыл бұрын
Briliant example :)
@foxlearn
@foxlearn 5 жыл бұрын
Thank you !
@Владимир_Великий_Русь
@Владимир_Великий_Русь 5 жыл бұрын
Ни хера не брильянт ! Столько доработок послей этой п....ы нужно делать.
@thisguythatguyify
@thisguythatguyify 4 жыл бұрын
If I try to connect with my public IPV4 address I get the error System.Net.Sockets.SocketException: 'The requested address is not valid in its context' in line 43 of the server app private void btnStart_Click(object sender, EventArgs e) { txtStatus.Text += "Server Starting..."; System.Net.IPAddress ip = System.Net.IPAddress.Parse(txtHost.Text); server.Start(ip, Convert.ToInt32(txtPort.Text)); } How do I fix this so that I can connect to other computers?
@demyanrudenko
@demyanrudenko 4 жыл бұрын
I've got a question not exactly about the client/server itself, but more as a follow-up. My server is fairly lightweight and I'd like to set it up on my personal PC for a time being. However even though I opened specific ports it needs to work, it's still not visible from the outside (obvsly if client is on the same machine as the server, it works without problems). Do you by any chance have any possible suggestions regarding this issue ? Everything remotely helpful is appreciated :)
@foxlearn
@foxlearn 4 жыл бұрын
If you wan to work outside, you should get a static ip address, then open port. configure your router map to static ip
@wooshch
@wooshch 6 жыл бұрын
The received message is difrent - it has some additional chart. If I send "1" I recive "1 " and lenght of this string is 2. How I can fix it?
@Alex-ABPerson
@Alex-ABPerson 6 жыл бұрын
There's probably a linebreak at the end.
@microsecure2612
@microsecure2612 6 жыл бұрын
this applications should be on the same network or can works on different network ? thx
@foxlearn
@foxlearn 6 жыл бұрын
Same network or you can host via internet
@microsecure2612
@microsecure2612 6 жыл бұрын
thank u for quick reply, how to host it via internet ?
@foxlearn
@foxlearn 6 жыл бұрын
You should public your ip and port, you can do that from your modem
@diabelli4life
@diabelli4life 7 жыл бұрын
First of all thanks a lot for this amazing tutorial, everything is running just fine....I was just wondering if it is possible to use the "server part" to connect to another device that acts as a client. I've been trying this all day long with no results. One of the main issues is that when I try to change the IP Address in the Server Form to the IP of the Client device I always get this exception: "the requested address is not valid in its context", can somebody please help me? :)
@foxlearn
@foxlearn 7 жыл бұрын
Do you mean that the server can connect to any computer on the listening port?
@diabelli4life
@diabelli4life 7 жыл бұрын
yeap, actually I have a computer that acts as a server, and a camera (a special camera that read licence plates) that is able to send messages through TCP protocol. So my camera is acting as the client. Bassically I need to stablish a conection between both of them. In the server application I feed the camera's IP address, and that's when the exception occurs. I have disabled firewall, I have tried opening different ports others than 8910, for instance the 5555, 9889, etc. But nothing seems to work :( .... any ideas? Thanks again in advance
@xbxb
@xbxb Жыл бұрын
So this can be used in 2 PCs, using Lan?
@d3zar
@d3zar 5 жыл бұрын
Uhmm if i start the client on connected via LAN computers to server computer, will it be work.?
@foxlearn
@foxlearn 5 жыл бұрын
Yes, it work, but you need to open port
@evo78829
@evo78829 6 жыл бұрын
Thank you so much about your demo example. Could you teach me how to send message from Server to Client? Thanks a lot again~
@foxlearn
@foxlearn 6 жыл бұрын
OK. Thank you for your suggestion !
@guillaume8437
@guillaume8437 4 жыл бұрын
Hello, Thanks Fox Learn for this nice video with step by step explanation. Very clear! Does someone has an idea of the reason why on the block private void Form1_Load(object sender, EventArgs e) does not work for me? It says 0 reference. At this point, I put all the 4 server lines in public Form1() block just after InitializeComponent(); and it works. This Form1_Load should be called somewhere, right?
@guillaume8437
@guillaume8437 4 жыл бұрын
OK, after a few look around, I got this : Go to Designer > Right Click form > Properties > Events (little lightning symbol) > Check if Form1_Load is available next to Load.
@foxlearn
@foxlearn 4 жыл бұрын
That's great
@aywon9531
@aywon9531 6 жыл бұрын
i cannot install TCP/IP in visual studio 2010 needed 4.5 framework. should i upgrade my visual or is there any other solution? 4.0 and higher is not compatible with 2010.
@DannaxOfficial
@DannaxOfficial 4 жыл бұрын
Can you make a video on how to do this without the nuget package? I'd like to know how that works thoroughly.
@foxlearn
@foxlearn 4 жыл бұрын
OK. Thank you for your suggestion. I'll upload soon !
@oskiGoiz
@oskiGoiz 6 жыл бұрын
Minuto 9:17 desaparece "new"... why?
@foxlearn
@foxlearn 6 жыл бұрын
What do you mean. Can you describe more details
@oskiGoiz
@oskiGoiz 6 жыл бұрын
​@@foxlearn Line 41, min 9:16, you are using "... = new System.Net...", later in min 9:17, unappear the word "new"... it's like magic
@CaptainChubbyDuck
@CaptainChubbyDuck 2 жыл бұрын
I get an error saying for the IPAdress. Wrong format exception. Cannot convert to IPAdress to long....
@Louis-zs1rq
@Louis-zs1rq 2 жыл бұрын
Can somebody help? If i connect i get this for the line server.Start(ip, ...) _> Object reference not set to an instance of an object
@alibarznji2000
@alibarznji2000 5 жыл бұрын
hello can i use this to send data between seperate computers?
@foxlearn
@foxlearn 5 жыл бұрын
Yes. You can
@alibarznji2000
@alibarznji2000 5 жыл бұрын
@@foxlearn thanks
@alibarznji2000
@alibarznji2000 5 жыл бұрын
i have one question though do i need to change any of the code to communicate between the compuaters?
@bassemk6555
@bassemk6555 Жыл бұрын
but if i want to make the client webpage to access it using my mobile, what i need to do?
@vorapobautomation9760
@vorapobautomation9760 3 ай бұрын
I have an error at this line server.Start(ip, Convert.ToInt32(txtPort.Text)); How to fix it ?
@sudhirkumar-xu7lp
@sudhirkumar-xu7lp 5 жыл бұрын
I am getting error as :- Input string was not in a correct format. An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll , while initializing IPAddress. When parsing txtHost.Text to long then it is throwing exception.
@foxlearn
@foxlearn 5 жыл бұрын
I think you miss something. Please check your code again. thank you !
@hungdoan9419
@hungdoan9419 3 жыл бұрын
help me: "An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll Additional information: Input string was not in a correct format."
@Saturno1.4.3
@Saturno1.4.3 7 жыл бұрын
en the client i have this problem here theClient.WriteLineAndGetReply(txtMessage.Text,TimeSpan.FromSeconds(3)); show this message 'Cannot send data to a null TcpClient (check to see if Connect was called)'
@justin23262
@justin23262 3 жыл бұрын
do you have solution for that?
@rupeshpatel232297
@rupeshpatel232297 7 жыл бұрын
hi i have question if you wanted to reply diffidently to particular message how can you do that? i am having problem detecting message string to something like time. it should detect add and reply to it time is something with zone and time period. my whole program is working if yo can fixed this and send it me on below addresss.it is one simple thing how can you detect the meassagestring like xxx and replyline to something zzzz from server
@puntangerslx2772
@puntangerslx2772 Жыл бұрын
does anyone know how to fix this problem on line 59 on the client application i can connect but cant send? "Cannot send data to a null TcpClient (check to see if Connect was called)"
@Inforcer275
@Inforcer275 4 жыл бұрын
I am using .NetCore in WPF and on my screen is says:"CS1660 Cannot convert anonymous method to type 'MethodInvoker' because it is not a delegate type". It´s in the method Server_DataReceived. Can anyone help me?
@foxlearn
@foxlearn 4 жыл бұрын
Try to remove Invoker, just copy code inside invoker block
@Inforcer275
@Inforcer275 4 жыл бұрын
@@foxlearn Thx can you use the SimpleTcp package to send files between the server and the clients? If it´s the case how does it work?
@peteriscirksis
@peteriscirksis 6 жыл бұрын
How to make it so that there can be multiple users at once right now if I open new client and connect the chat only works that the client that sends only sees what it wrote
@rupeshpatel232297
@rupeshpatel232297 7 жыл бұрын
can you make tcp /ip multiple client per server application.server should able to talk with each client differently by selecting their name
@정도현-r6b
@정도현-r6b 7 жыл бұрын
hi im korean little en.. sorry, My error is Client send button click : Cannot send data to a null TcpCilent(check to see if Connect was called) why error??
@foxlearn
@foxlearn 7 жыл бұрын
Hi, Please check your IP, Port again. Thanks
@alaouchicheabdellah4986
@alaouchicheabdellah4986 7 жыл бұрын
+정도현, hi amigo, you right. there is a line not shown in a video.it is located in the connect_button_click { connect_button.Enable = false; client.Connect(hostTextBox.Text, Convert.ToInt32(portTextBox.Text)); } should work, don't forget to correct the IP address format, it s not shown in the video too. is not IPAddress(long.Parse()); it s directly IPAddress.Parse(); hope it helped.
@tenmamico
@tenmamico 4 жыл бұрын
how to fix in btnSend_click client.WriteLineAndGetReply(txtMessage.Text, TimeSpan.FromSeconds(3)); System.Exception: 'Cannot send data to a null TcpClient (check to see if Connect was called)'
@thuannguyen8248
@thuannguyen8248 4 жыл бұрын
How to fix it, help me.
@justin23262
@justin23262 3 жыл бұрын
@@thuannguyen8248 làm được phần đó chưa bạn?
@thuannguyen8248
@thuannguyen8248 3 жыл бұрын
@@justin23262 Rồi bạn
@justin23262
@justin23262 3 жыл бұрын
@@thuannguyen8248 thay đổi code chỗ đấy như thế nào để hết bị lỗi bạn, bạn giúp mình được không?
@nubhacker7852
@nubhacker7852 4 жыл бұрын
Hello! I have a problem with the app. If I try to connect with friends, the app freezes and gives the error: "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond". Can you help me please? Thanks!
@foxlearn
@foxlearn 4 жыл бұрын
This only work on local network, and don't forget to open your port in firewall
@buingocanh2233
@buingocanh2233 7 жыл бұрын
you teach quickly If you want everybody to learn. you should make it slowly
@theamici
@theamici 7 жыл бұрын
There are buttons on video for speed-control. I watched it at double the speed because it was too slow for me.
@ManojYadwad2
@ManojYadwad2 6 жыл бұрын
Client form connect button is incomplete or there is some error in send button in client side. The error says that "Cannot sent data to null TcpClient.(check to see if connect was called).
@JohnSmith-ed1sr
@JohnSmith-ed1sr 6 жыл бұрын
you have to start it in the right order, follow the video exactly, make sure you are starting the server and client in the correct order.
@HungPham-fl8py
@HungPham-fl8py 5 жыл бұрын
hi , i test your code carefully and check all information detailedly, i dont know why i still have an error "nullreferenceexception object reference not set to an instance of an object" in the line could you help me please :D ?
@ErnstStefanBruhn
@ErnstStefanBruhn 5 жыл бұрын
I had the same error, maybe because I only made the client part of the project, here is what I was missing to get it to work: private void btnConnect_Click(object sender, EventArgs e) { client = new SimpleTcpClient().Connect(txtHost.Text, Convert.ToInt32(txtPort.Text)); btnConnect.Enabled = false; }
@maltewerner2482
@maltewerner2482 7 жыл бұрын
This only works on my pc not in the network can somebody help
@SunShine24024
@SunShine24024 4 жыл бұрын
Greate
@foxlearn
@foxlearn 4 жыл бұрын
Thank you !
@thecauliflower4982
@thecauliflower4982 6 жыл бұрын
Hello, I got a problem at the IP address: When my program runs I get this exception: 'Input string was not in a correct format.' . Can you help me with that?
@silvileblanc3763
@silvileblanc3763 5 жыл бұрын
me too...
@abdulsalam6071
@abdulsalam6071 6 жыл бұрын
I have problem in btnStart in line : System.Net.IPAddress ip=new System.Net.IPAddress(Long.Parse(txtHost.Text)); the problem is: Input string was not in a correct format. Plz help me ..
@mostafatehrani3662
@mostafatehrani3662 6 жыл бұрын
remove (New)
@hungdoan9419
@hungdoan9419 3 жыл бұрын
@@mostafatehrani3662 "System.Net.IPAddress ip = System.Net.IPAddress(long.Parse(txthost.Text));" can't OK
@cuongnp_fptedu3841
@cuongnp_fptedu3841 5 жыл бұрын
How to send messenger from Server to multi clients? Can you help me? Thanks you a lot!
@foxlearn
@foxlearn 5 жыл бұрын
You can use Signalr
@xagareymeyer4565
@xagareymeyer4565 7 жыл бұрын
Mine doesn't print out to the 'chat box' or status box. It does print on the server's status box
@DARKAR_117
@DARKAR_117 8 жыл бұрын
great work :D , and what happen with the music :( ??
@foxlearn
@foxlearn 8 жыл бұрын
Thank you, I haven't embedded background music, some people suggest to remove the background music. I want to know it's good ? i think background music make the tutorials attract !
@DARKAR_117
@DARKAR_117 8 жыл бұрын
yeah the music give personality to the videos :D, pls set the music back again :D
@foxlearn
@foxlearn 8 жыл бұрын
Thank you so much :)
@DARKAR_117
@DARKAR_117 8 жыл бұрын
And a personal suggest, pls you can make a more extense tut of Material skin Nuget pls, only you can made it awesome :D
@yali5549
@yali5549 3 жыл бұрын
How do I check what message was sent to the client? is there a way to do that?
@cyd0c505
@cyd0c505 7 жыл бұрын
Can I use it with non-local ip, like my friends' ? (Sorry for my Eng)
@foxlearn
@foxlearn 7 жыл бұрын
Yes, Input your real ip, then you can play
@randobigor
@randobigor 4 жыл бұрын
26 line: client.Connect(ipInput.Text, Convert.ToInt32(portInput.Text));
@foxlearn
@foxlearn 4 жыл бұрын
What error are you getting?
@mahiracar6364
@mahiracar6364 2 жыл бұрын
hello dear writers ı had downloaded your dll files but tcp server function has problem. can not convert from string to parse which given ip adress in text box .solved ip adress appointed in code form load . but this time lose so benefitted for me . thax alot
@TheMr902
@TheMr902 6 жыл бұрын
Hey, i have a question. I was wondering if you can get the Ip address of the client that is sending the messages, and if yes, can you give me the code to it, or help me do this? thanks a lot in advanced
@foxlearn
@foxlearn 6 жыл бұрын
Yes, You can. I'll upload video as soon as possible
@TheMr902
@TheMr902 6 жыл бұрын
thank you so much!!
@TheMr902
@TheMr902 6 жыл бұрын
i have tried a lot of different commands, one of them being this : EndPoint ipi = client.TcpClient.Client.RemoteEndPoint; string ipe = ipi.ToString(); Console.WriteLine(ipe); it does not matter what command i trie to put, i get null excelption, like : SimpleTCP.SimpleTcpClient.TcpClient.**get** returned null. I know you said that you are gonna put a video as soon as possible, and i thank you for that, but i just wanted o give you a little bit of context, maybe it will help you. thank you again
@brightonkatsuwa3180
@brightonkatsuwa3180 7 жыл бұрын
More thanks from me and more tutorials we are disparate for how to create messenger like whatsapp
@foxlearn
@foxlearn 7 жыл бұрын
Thank you
@444guns
@444guns 7 жыл бұрын
A rather poor tutorial, even though with a bit of tweaking it works. Several code fragments were not visible, like on client connect button you should have something like client.Connect(EDIT_IPADDRESS.Text, Convert.ToInt32(EDIT_PORT.Text)); not just btnConnect.Enabled=false; On top of that code changes from one moment to another in the video, which is a bit awkward. On top of that the voice is an AI synthesized voice, instead of a real voice. Oh and by the way, that SimpleTCP plugin you install requires .NET 4.5, which should have been important to mention. Try better next time !
@Alexander-wz9nu
@Alexander-wz9nu 7 жыл бұрын
thank you for that client.Connect(EDIT_IPADDRESS.Text, Convert.ToInt32(EDIT_PORT.Text));
@epiphanmushahwar6671
@epiphanmushahwar6671 6 жыл бұрын
mate sure their tutorial had some stuff wrong with it but there's no need to be this mean about it sheesh
@dafraggaming-ab4982
@dafraggaming-ab4982 8 жыл бұрын
This is what i had expected from you.. Please do a more tutorial on TCP/IP Please? Thanks n Nice Work!
@dafraggaming-ab4982
@dafraggaming-ab4982 8 жыл бұрын
btw, i ve published my chat app which i was talking about, please check it. xchat-tecdevs.cf and now i want to add a Audio Call feature,but i dont know where to start, should i use TCP/IP to make a app which acts on my pc as a server and transmit each users data to where it should go? or should i go with a webserver?
@foxlearn
@foxlearn 8 жыл бұрын
Ok. Thank you for your suggestion
@philipm1896
@philipm1896 7 жыл бұрын
Th3 SHoCK www.codeproject.com/Articles/138484/Simple-SIP-VOIP-based-phone-in-C
@mertaksu6705
@mertaksu6705 5 жыл бұрын
I would like to add a database to this project. how? thank you for video
@foxlearn
@foxlearn 5 жыл бұрын
Let me try to research. can you describe more details. thank you !
@mertaksu6705
@mertaksu6705 5 жыл бұрын
@@foxlearn will be saved in the database after sending a message, again thank you
@mertaksu6705
@mertaksu6705 5 жыл бұрын
@@foxlearn Hello again, did you find it?
@technologybeat1186
@technologybeat1186 5 жыл бұрын
how Server send message to Client ??
@yeakleang
@yeakleang 8 жыл бұрын
There are error when starting server and sending message in client form.
@foxlearn
@foxlearn 8 жыл бұрын
Hi, Please check your ip server and client again. Make sure your code is correct. Thanks
@yeakleang
@yeakleang 8 жыл бұрын
No, you didn't show this code "client.Connect(txtHost.Text, Convert.ToInt32(txtPort.Text));" when clicking connect button in client form. check your video again.
@JohnSmith-ed1sr
@JohnSmith-ed1sr 6 жыл бұрын
Thanks for catching that yeakleang, i added your bit of code and now have a socket error that says "A socket operation was attempted to an unreachable network. 0.0.34.206:8910 Can you tell me what that means? I would really like to get this to work. Thanks in advance
@nishanegi2525
@nishanegi2525 6 жыл бұрын
Is this application for multiple clients
@foxlearn
@foxlearn 6 жыл бұрын
Yes
@nishanegi2525
@nishanegi2525 6 жыл бұрын
@@foxlearn then Y it's not working for multiple clients?
@foxlearn
@foxlearn 6 жыл бұрын
You should config local ip
@nishanegi2525
@nishanegi2525 6 жыл бұрын
@@foxlearn when I click on send button then it's showing exception
@foxlearn
@foxlearn 6 жыл бұрын
Please turn off your firewall, change another port. ip host is your computer ip
@warmice8265
@warmice8265 4 жыл бұрын
How can i find IP ADDRESS and PORT ? Thanks !!!
@flyrkr3937
@flyrkr3937 4 жыл бұрын
this is your ip and a port that you need to enable on your router settings
@Confety
@Confety 6 жыл бұрын
Mejor pongo en el Load para que se auto conecte? Se puede?
@ocelotlocelotl
@ocelotlocelotl 6 жыл бұрын
si se puede, pero te dará error al abrir la aplicación si el servidor no se esta ejecutando, lo que puedes hacer es incluir las lineas en un try, catch y un boton de conectar, o intentar conectarte cada determinado tiempo.
@blakemckee295
@blakemckee295 6 жыл бұрын
You didn't include the connecting method in the client side of this video....
@7Rossik
@7Rossik 6 жыл бұрын
How do I send a data packet rather than one value? Thanks
@foxlearn
@foxlearn 6 жыл бұрын
Thank you for your suggestion !
@eceblog7454
@eceblog7454 2 жыл бұрын
Hi, In the server how we can get the connect client IP address and port number
@kiritoyan08
@kiritoyan08 2 жыл бұрын
you did not include the code for Connect button in the video and the code for Start button has an error
@yahyahoush313
@yahyahoush313 8 жыл бұрын
Thank you :) But can you add a music to video like the other videos Because there are a lot of noisy in the Video Thanks
@foxlearn
@foxlearn 8 жыл бұрын
Thank you
@dafraggaming-ab4982
@dafraggaming-ab4982 8 жыл бұрын
Yahya Housh Yes, and i love his default music which he used on most videos. :p
@yahyahoush313
@yahyahoush313 8 жыл бұрын
:) thanks
@ralphlawrencedeverarillera9883
@ralphlawrencedeverarillera9883 3 жыл бұрын
how do you remove trailing exclamation marks?
@林國善
@林國善 7 жыл бұрын
How the server sends a message to the client? plz help me thx.
@foxlearn
@foxlearn 7 жыл бұрын
OK. Thank you for your suggestion. I'll make soon
@philipm1896
@philipm1896 7 жыл бұрын
林國善 server.broadcastLine("hello");
@林國善
@林國善 7 жыл бұрын
thank u so much :).
@danms6586
@danms6586 7 жыл бұрын
Hey Fox Learn, i have a problem, when i press the buton "Start" the form application stopped working, i don't know why, here is a photo with my problem, imgur.com/a/lAI8c , can you help me? Thanks.
@dipintigupta9777
@dipintigupta9777 Жыл бұрын
Sir, i wanna ssl/tls connection with communicate
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
C# Tutorial - SuperSimple TCP/IP Client Server | FoxLearn
23:11
Fox Learn
Рет қаралды 114 М.
C# Tutorial - TCP/IP Client Server
27:03
winforms
Рет қаралды 19 М.
Building a TCP Client in C#
12:19
Elevate Cyber
Рет қаралды 19 М.
TCP/IP Server & Client Communication - C# Programming
14:10
Chat tcp/ip server client C# Super Eazy
23:12
DoctorX
Рет қаралды 4,7 М.
C# Socket Programming - Multiple Clients
29:08
Brian (Able Opus)
Рет қаралды 362 М.
C# Tutorial - Print Receipt using Report Viewer | FoxLearn
20:03
C# Tutorial - Material Design for .NET WinForms | FoxLearn
10:01
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН