Sunday, April 3, 2016

X-Files ; Sockets 3rd and last ; TESLA car


Finally this is last of Sockets, in this I am attaching the zip file of Server and Client Code.

Server will open a server socket and listen to client connection.

Client will open a connection with Server and wait for any input data.

server will send "Hello from Server" to client.

The code is very basic, there is no extra line of code which is not required. NOTE : this app will have problems, as optimized coding is not done.


Also UI-wise,  Server has just one text box, in which Server IP address is shown.

Client has two text-box , in one we will input the Server IP address in other Text Box the message send by server will be displayed.


Also you will see implementation of ASYNC task at server side. It is required to create connection and wait for CLIENT request. First I thought that is not required, but my UI was unresponsive without implementing it.

Reason : socket.accept() call is blocking call, until some client doesn't request connection , further code execution will not take place.

That's it amigo's.


Coming to second part, I was watching X-files,  it's not so good. But there was a question which came to my mind.

1) Is apeing greater than pure genius ?


Now I always wanted to do socket programming, but my inherent nature doesn't allow me to understand other people code. My brain just shuts down, when some one tells me how something worked.

I like to learn by my own. But what I have seen, learning by your own , discovering what other have discovered , reinventing the wheel should be attributed to DUMB people.

The very foundation of human society is build on SHARING.We learn from other experience, other mistakes, other success and this learning shortens next generation re-learning curve.

Now I was talking with my roommate, and he was telling me about TELSA car. What was beautiful in that CAR is that they have MACHINE LEARNING.  So if you are taking your car to some place and say it is hilly terrain. You have some sharp turn and did skid, the next time any TELSA car goes on that route will know what speed is dangerous on that turn.



Wow !!!!

Same way , what I coded in socket programming was learning from the 3-4 applications made by others.

But sometimes I feel what if everything we are learning is not natural but artifical ?

Like the matrix movie, where they show everyone is kept in a chamber and their brains are feed with real world image.

Telling even LIES a hundred times, makes it a truth. This is how we humans are.

What if the CASTE, COLOR, COUNTRIES we have created are in interest of FEW people. And we are told/teached whatever they want.

So it also raises one interesting question :


Do we want to live in harsh reality or beautiful truth ? 
`

It seems there is no option of attaching files to blogspot, so here is link for drive

https://drive.google.com/folderview?id=0B6HF3JcgAklva0VsSWIzZDZldG8&usp=sharing

No comments:

Post a Comment