Posts

Showing posts from May, 2019

Firebase Cloud Functions

Image
Introduction to Firebase Cloud Functions If you have never heard of cloud functionality, the concept is very simple. Deploy simple logic to the server in the form of a function, and invoke a hardworking sprite magically to perform tasks. All this pays only for running resources, without worrying about the infrastructure. In many cases, this new paradigm makes it easy to create, maintain, and execute back-end code. The Firebase Cloud feature is particularly similar to the LEGO module that can connect to any Firebase service. For example, you can trigger functions when uploading images to Firebase Storage to create thumbnails or erasing user data when deleting a node in a live database. Everything that happens with Firebase can trigger a feature. If this is not enough, you can also use HTTP to trigger via GET, POST, etc. Watch a great video on how to create a complete Express app using Firebase Hosting with Cloud capabilities. What can do Firebase Cloud Functions  N...

Socket Programming

Image
Introduction to Socket Programming This Post describes a very basic one-way client and server setup where clients connect, send messages to the server, and the server uses socket connections to display them. There are a lot of low-level things needed to make these work well, but the Java API network package is responsible for all of these, so programmers can easily do network programming. Client Connection Establish a Socket Connection You need a socket connection to connect to other machines. Socket connection means that two machines have information about each other's network location (IP address) and TCP port. The java.net.Socket class represents a Socket. To open a socket: Socket socket = new Socket(“127.0.0.1”, 5000) First argument –  IP address of Server . ( 127.0.0.1  is the IP address of localhost, where code will run on single stand-alone machine). Second argument –  TCP Port . (Just a number representing which application to run on a ser...