Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. socket.on('data', function(chunk){
  2. decodeChunk(chunk.toString('hex'), function(response){
  3. if(response.name === 'toDB'){
  4. //write smth. to DB
  5. }
  6.  
  7. if(response.name === 'readDB'){
  8. //watch all incoming tcp sockets with 'toDB' and continiously
  9. //send to client connected with this socket
  10. }
  11.  
  12. });
  13. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement