Socket Programming in Java One Way

  Рет қаралды 183,101

Telusko

Telusko

Күн бұрын

Пікірлер: 141
@omkattarle8
@omkattarle8 Жыл бұрын
Как замечательно иметь такого прекрасного учителя на KZbin! Я хотел бы выразить свою искреннюю благодарность за все знания и информацию, которые вы делитесь со мной и другими зрителями. Ваше усердие и преданность в деле обучения заслуживают самой высокой оценки. Спасибо вам за ваше время и труд, которые вы вкладываете в создание контента на KZbin. Я ценю все уроки, которые вы даете, и надеюсь, что ваше вдохновение и знания продолжат помогать другим ученикам в их учебе. Еще раз огромное спасибо за ваше прекрасное обучение на KZbin! 😄
@DeoSTerriere
@DeoSTerriere 2 жыл бұрын
Some helpful tips: 1. Temporarily disable your firewall to prevent firewall from stopping network traffic on your chosen port (9999) 2. You can use ObjectOutputStream os = new ObjectOutputStream(s.getOutputStream()); PrintWriter out = new PrintWriter(os); out.println(msg); os. close(); in your client.Telusko corrects his mistake in the next video called "Socket programming in Java Two Way". But this also works as seen in the video, so actually you don't need the PrintWriter object: os.write(msg); os.close(); 3. IMPORTANT: Start your SocServer first and SocClient next! 4. You have two consoles, because you start two programs. The server is printing the incoming message too its console. So when you see no message, you're probably looking in the console of the client.
@biruh-edu
@biruh-edu 26 күн бұрын
You are the best java lecturer on entire website.
@faiseen_talks
@faiseen_talks 7 жыл бұрын
Best instructor ever and ever. I'm a big fan of you sir. thanks a lot.
@vinayakgarments9182
@vinayakgarments9182 2 жыл бұрын
Watching this video in 2023..
@alixaprodev
@alixaprodev 4 жыл бұрын
you are doing very great man. I am learning too much from your channel.
@royrao951
@royrao951 8 жыл бұрын
I think you missed "os.close(); " in the client program, right?
@arveersingh9728
@arveersingh9728 8 жыл бұрын
as long as i know it is not necessary to close every reference.
@abhijeetrastogi7087
@abhijeetrastogi7087 8 жыл бұрын
But it was necessary in my case. as without it the client thread was being closed even before it flushed the data.
@programmingforbeginners8706
@programmingforbeginners8706 8 жыл бұрын
tnx man . .i just found my error . after looking . to run my prog so many times
@kundan625
@kundan625 7 жыл бұрын
Thanks man
@moonbrush5
@moonbrush5 7 жыл бұрын
Saved my time. Thanks!
@g-l8492
@g-l8492 4 жыл бұрын
If you get a Error looking like this: java.net.ConnectException: Connection Refused -> It could have following solutions: 1. start server before client, 2. turn off your firewall, or, which worked for me: 3. in your Clien class, make the String end the line with appending like this: String str = "Navid Reddy " (-> br.readLine() expects a full line (at least on my computer?), I don't know why the code shown in the tutorial seems to work for so many people without ending the line)
@musfikuroli
@musfikuroli 3 жыл бұрын
Thanks a lot. Just adding " " worked for me.
@JohnDoe-ml2zy
@JohnDoe-ml2zy 2 жыл бұрын
@@musfikuroli Thanks a lot bro you saved me from going on an endless hunt on StackOverflow Edit: You too @G-L
@ankanpal9163
@ankanpal9163 9 ай бұрын
didnt worked bro
@bashamsk1288
@bashamsk1288 8 жыл бұрын
man u r excellent i wasted 2days(12hours) on "what is socket " and u explained just in 2 min and u also told how use socket i subscribed and thank u very much ,i wanted to create a client android app can use this coding?
@Cowboy1Brian
@Cowboy1Brian 7 жыл бұрын
Did you ever get an answer to this question? Im trying to find out how to send coordinates from one device to another, and display those coordinates in a map on that other device.
@xGrofx
@xGrofx 7 жыл бұрын
Best tutorial on the subject! Thanks mister!
@parwana1000
@parwana1000 7 жыл бұрын
Hi navin,i am new to java. Can you tell me what is the use of out variable in socClient program? I mean purpose, as it's not being used... Thank you so much for making such video. You have changed the way of learning and studying. Thank you and and I mean it seriously
@marcusleeeugene
@marcusleeeugene 7 жыл бұрын
Great tutorial! You helped me understand about TCP connections! :)
@Mr47even
@Mr47even 8 жыл бұрын
Hey buddy , Grate and simple tutorial . BTW , I did not get it why did you create Print Writer , because you never used it . Thx in advance.
@saadmanahmed860
@saadmanahmed860 4 жыл бұрын
exquisite illustration as usual.Your keynotes have always rendered me some good coding understanding
@koushikshomchoudhury9108
@koushikshomchoudhury9108 7 жыл бұрын
My first networking program! Thanks :) tutor!
@meghamalhotra7814
@meghamalhotra7814 8 жыл бұрын
Sir , Thanks for such a good tutorial.
@santhoshmedide5279
@santhoshmedide5279 8 жыл бұрын
You know well ,to teach beginners!!
@reshamdevirajasthan2124
@reshamdevirajasthan2124 5 жыл бұрын
Very good explanation..Thanks
@KarshSoni
@KarshSoni 8 жыл бұрын
Awesome Telusko Learnings
@ravindrareddy2822
@ravindrareddy2822 8 жыл бұрын
chala baaga chepparu thanq
@cassi4790
@cassi4790 2 жыл бұрын
that was very helpful!tysm
@ziddy26
@ziddy26 7 жыл бұрын
+Telusko Learnings Why was the PrintWriter created? It was never used. Also I tried without PrintWriter. It worked fine for me. OutputStreamWriter osw = new OutputStreamWriter (clientSocket.getOutputStream()); osw.write(message); osw.close(); Is it necessary to create PrintWriter object? Thanks
@ashwanikumar4288
@ashwanikumar4288 6 жыл бұрын
I also have the same doubt
@curiousgeorge6307
@curiousgeorge6307 4 жыл бұрын
I was also wondering the same thing
@jintujose_28
@jintujose_28 8 жыл бұрын
Could you please create a video for how to create a directory on the server side using socket programming in java
@PratikShende91
@PratikShende91 6 жыл бұрын
we can also use out.println() in place of os.write().
@chhaylin3210
@chhaylin3210 5 жыл бұрын
Great video
@vanrensburg3760
@vanrensburg3760 4 жыл бұрын
Nicely explained thank you, can you talk about how a server can generate a unique ID for client that connects and how one client can communicate with another, through the server.
@xiaoyingsun4581
@xiaoyingsun4581 4 жыл бұрын
Thanks for the generous share. Btw which kind of Projects did you initiate?
@cringelord511
@cringelord511 3 жыл бұрын
java project
@ashishposte8192
@ashishposte8192 7 жыл бұрын
In the Client program ,you have created Printwriter but you did not use it at all.
@ishajha1243
@ishajha1243 6 жыл бұрын
Thank You Sir
@sauravmukherjeecom
@sauravmukherjeecom 9 жыл бұрын
Nice. Do u have anything about Java XML parsing?
@eren96lmn
@eren96lmn 8 жыл бұрын
os.write(str) line should be replaced with out.println(str) to work properly on some systems.
@ayushpratik4208
@ayushpratik4208 6 жыл бұрын
Same problem was with me........thanx for ur help
@ALSAHER79
@ALSAHER79 5 жыл бұрын
Eren L Thanks a lot. I wasted more than 2 hours to fix the issue.
@anmjubaer
@anmjubaer 5 жыл бұрын
Thanks a lot man.
@pruthvirajjadhav1996
@pruthvirajjadhav1996 4 жыл бұрын
great help !! but what it makes difference ?
@ajinkyasanas2256
@ajinkyasanas2256 3 жыл бұрын
Thank u so much
@VrlHtzz
@VrlHtzz 4 жыл бұрын
Why my program get terminated when I run client class ...... Server runs fine Wht should I do
@singh6569
@singh6569 9 жыл бұрын
Thanks for tut. Just few questions. Do you have tut about JSP? To learn JSP ,do someone need to learn JAVA first. What is different b/w java nd JSP? Thanks
@ankushroy919
@ankushroy919 4 жыл бұрын
do we need same package for client and server?
@hussain1755
@hussain1755 8 жыл бұрын
why did u create printwriter "out" ?? you never used it in the client socket
@SM-vo5gj
@SM-vo5gj 8 жыл бұрын
this is what i was wondering, and possibly is source of problems a couple comments up- with os.write ... should it have been out.write?
@hemanth6951
@hemanth6951 8 жыл бұрын
hi,i am your fan from long year,but you never noticed me
@shubhamsangale890
@shubhamsangale890 6 жыл бұрын
Sir, even if pass value "true" with the str in printwriter it works!!! can you please let me know the reason??
@onlyforstudy7183
@onlyforstudy7183 3 жыл бұрын
Plzz more explain about program
@varundurvasula7536
@varundurvasula7536 5 жыл бұрын
Can we achieve this by using scanner? (instead of bufferedreader)
@andevinay1494
@andevinay1494 5 жыл бұрын
where you have used Print Writer object out in the client class
@anwarulkaium1101
@anwarulkaium1101 6 жыл бұрын
Hi Navin, thanks for this wonderful video. How would I transfer a List of elements from a server to client by using DataInput/OutputStream. I tried with out.write(list), it does not work. Your reply will be highly appreciated.
@ramzi-sah
@ramzi-sah 5 жыл бұрын
7:18 nine nine nine nine mine furheur
@AYAN454
@AYAN454 4 жыл бұрын
where do we need "out" variable then?
@hristoplamenov1942
@hristoplamenov1942 6 жыл бұрын
Hello guys, just one question - why it deletes the information in the client side after i run it ? It shows the Navin Reddy and then black screen :/
@mridulmishra8166
@mridulmishra8166 7 жыл бұрын
Hi Naveen, you are a life saver. Any plans on making creating JavaScript playlist?
@satadhi
@satadhi 6 жыл бұрын
why will you use opera when you have a mac ?
@Onomandah
@Onomandah 6 жыл бұрын
What was the purpose of creating a PrintWriter object??
@JohnDoe-ml2zy
@JohnDoe-ml2zy 2 жыл бұрын
I have a problem: When I run the client side, it says "Connection Reset" error on the server console. How can I resolve this?
@DirtyDan612
@DirtyDan612 5 жыл бұрын
When I run the server I get the two statements to print but when i run the client nothing happens, any ideas why? My code is exactly the same.
@sajithkumaresan3645
@sajithkumaresan3645 7 жыл бұрын
Hi can you please make a video regarding sockets in java script.
@ramsha910
@ramsha910 7 жыл бұрын
sir how to sent commend also make a video
@vidyasagar-qe9ds
@vidyasagar-qe9ds 5 жыл бұрын
how to receive the data from the GPS device /Hardware ,GPS will be sending the data to predefined IP address , please guide
@satadhi
@satadhi 6 жыл бұрын
what does line 17 do ? in cient side
@orz5516
@orz5516 6 жыл бұрын
if i have a real client - written in angularJs, how this is different? thanks
@anchitajain6066
@anchitajain6066 8 жыл бұрын
I can't main class with different name as project name and this then gives error on making 2 main class files in same project. I am working in net beans. what should I do ? please help ..
@priyankamonalisa2028
@priyankamonalisa2028 8 жыл бұрын
Hi, Could please tell me how to do this client-server in 2 different system in same network? I tried to give the IP of server in client, but it didnt work?
@pullareddyanumula5153
@pullareddyanumula5153 9 жыл бұрын
how to send file client to server
@ujjalsamanta5841
@ujjalsamanta5841 6 жыл бұрын
sir i need full courses network programming on Python. i am ready to buy it.
@kaustubh21
@kaustubh21 4 жыл бұрын
I want to pass 2 values from client i've written os.write(val1) and os.write(val2) but how can i accept them on the server
@priyamnagar1497
@priyamnagar1497 8 жыл бұрын
On my system os.write() is giving a SocketException but when i use out.println() , then it is working . Why did this happen???... Please Reply.
@realprince1107
@realprince1107 Жыл бұрын
Can anybody tell where is the next video, please?
@yuyuliang2311
@yuyuliang2311 6 жыл бұрын
I have written the same code. But the server never connect with client, although their port are same.I have checked the code many times. But I can't find the problem yet.
@SourabhMaybhate
@SourabhMaybhate 6 жыл бұрын
what error your getting?
@manish.periwal
@manish.periwal 7 жыл бұрын
how to communicate between two remote machines?
@ydtj20
@ydtj20 3 жыл бұрын
Exception in thread "main" java.net.SocketException: Connection reset sir how to handle this?
@williamletwaba2753
@williamletwaba2753 8 жыл бұрын
How can 1 send an XML message to the server?
@akashshrestha01
@akashshrestha01 5 жыл бұрын
Cool
@lololollolololo3650
@lololollolololo3650 7 жыл бұрын
Why have you created PrintWriter object ,, out ,, and you dont use it?
@arunberlin
@arunberlin 7 жыл бұрын
i have the same doubt...do u know y ?
@myfunnyvideos8285
@myfunnyvideos8285 9 жыл бұрын
plz upload chat application..
@sagarbathla5160
@sagarbathla5160 5 жыл бұрын
can anyone please tell how to connect two clients using socket instead of client and server
@suryabhagavan8390
@suryabhagavan8390 7 жыл бұрын
HI, This is bhagvan. Iam getting NetworkOnMainThreadException when rnning this code. I was tried in google but there are no source. can you please tell me why this coming. give the link for referance if possible. Thank q
@susannaantinyan4595
@susannaantinyan4595 6 жыл бұрын
out.close(); after os.flush();
@wilburtmoreno469
@wilburtmoreno469 6 жыл бұрын
i did excatly whats in your program. and an erroe accured is says. "java.net.SocketException: connection reset" how can i solve this error?
@duff2233
@duff2233 6 жыл бұрын
in client program there is a os.close(); missing after flush()... I had the same problem
@gouravthapa5815
@gouravthapa5815 6 жыл бұрын
In client class. insert a newline character in end of your data. e.g println("Nanin Reddy "); because readLine() function need a newline character to stop reading.
@akhilmishra624
@akhilmishra624 6 жыл бұрын
Exception in thread "main" java.net.UnknownHostException: local host at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.(Socket.java:434) at java.net.Socket.(Socket.java:211) at Client.main(client.java:12) ..sir i am getting this error ...what to do?
@amartyachakraborty5739
@amartyachakraborty5739 7 жыл бұрын
" java.net.SocketException: Connection reset " sir i am getting this error .. what to do?
@arunberlin
@arunberlin 7 жыл бұрын
You need to close the outputstream object and socket object Add these 2 lines after os.flush(); out.close(); s.close();
@susannaantinyan4595
@susannaantinyan4595 6 жыл бұрын
only out.close() is enough.
@SourabhMaybhate
@SourabhMaybhate 6 жыл бұрын
yeh..it works
@corporateexplorer6544
@corporateexplorer6544 7 жыл бұрын
java.net.SocketException: Connection reset sir please help ye exception aaa rhi h
@mandarkulkarni5341
@mandarkulkarni5341 2 жыл бұрын
I am sending integer then the server is getting -1
@mandarkulkarni5341
@mandarkulkarni5341 2 жыл бұрын
Please help
@WaqarAli-me5xg
@WaqarAli-me5xg 3 жыл бұрын
I have copied same code,but not working
@Sagarloona
@Sagarloona 8 жыл бұрын
Exception connection reset on same code
@biswamohandwari6460
@biswamohandwari6460 4 жыл бұрын
Socket programming don't words over WiFi
@dragon_warrior_
@dragon_warrior_ 4 жыл бұрын
IDK why people uses JAVA for socket Programming as there is python which is very easy and simple to use then ,I'm just here because tommorow is my exam :/
@vennivennela8188
@vennivennela8188 7 жыл бұрын
sir,how to send message two separate computers using Sockets
@ANKITSingh-eg4ww
@ANKITSingh-eg4ww 3 жыл бұрын
Code not running, please check before uploading, terrible program...
Java Socket Programming - Multiple Clients Chat
40:18
WittCode
Рет қаралды 191 М.
Socket Programming in Java Two Way
4:59
Telusko
Рет қаралды 78 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Socket Programming Using Python
17:07
Telusko
Рет қаралды 308 М.
Logging in Java using Log4J
1:06:44
Telusko
Рет қаралды 10 М.
Multithreading in Java Explained in 10 Minutes
10:01
Coding with John
Рет қаралды 996 М.
Java Socket Programming Client Server Messenger
16:28
WittCode
Рет қаралды 111 М.
UDP Socket Programming in Java Tutorial
20:27
Telusko
Рет қаралды 128 М.
Java Socket Programming Part 1
14:46
David Dobervich
Рет қаралды 45 М.
Java Database Connectivity | JDBC
20:34
Telusko
Рет қаралды 375 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН