CSJ-K / Exercises

Exercises for Java Programming Practice
0 stars 1 forks source link

Add socket support #4

Open minghao-wang opened 2 years ago

minghao-wang commented 2 years ago

Please accept my pr and add socket support on this codebase: When I connect to the port (ex 233) with tcp tool (ex netcat nc localhost 233) Given input nothing Then I get out like:

Website{id=1, name='Google', url='https://www.google.cm/', alexa=1, country='USA'}
Website{id=2, name='淘宝', url='https://www.taobao.com/', alexa=13, country='CN'}
Website{id=3, name='菜鸟教程', url='http://www.runoob.com', alexa=5892, country=''}
Website{id=4, name='微博', url='http://weibo.com/', alexa=20, country='CN'}
Website{id=5, name='Facebook', url='https://www.facebook.com/', alexa=3, country='USA'}
minghao-wang commented 2 years ago

Please refer to this https://www.baeldung.com/a-guide-to-java-sockets for more API info