Skip to content

Instantly share code, notes, and snippets.

@PierreJanineh
PierreJanineh / SocketDelegate.swift
Last active October 24, 2024 07:19
Connect to socket using Swift 5
protocol SocketDelegate: class {
/**
Called when `StreamDelegate` calls `stream(,eventCode)` with `.hasBytesAvailable` after all bytes have been read into a `Data` instance.
- Parameter result: `Data` result from InputStream.
*/
func socketDataReceived(result: Data?)
/**
Called when `StreamDelegate` calls `stream(,eventCode)` with `.hasBytesAvailable` after all bytes have been read into a `Data` instance and it was nil.

Keybase proof

I hereby claim:

  • I am pierrejanineh on github.
  • I am pierrejanineh (https://keybase.io/pierrejanineh) on keybase.
  • I have a public key ASB9Ixxv8StmLCk2J0P2Vu6L5OscwCu4KE5ziNmxBc6RtAo

To claim this, I am signing this object:

@PierreJanineh
PierreJanineh / hosts
Created May 21, 2019 14:01
HostsFile
127.0.0.1 localhost
000.0.0.0 yourDomain.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
@PierreJanineh
PierreJanineh / commandLines.bat
Last active May 21, 2019 14:01
Setting up VM Instance
// Update and upgrade operating system.
sudo apt-get update
sudo apt-get upgrade
// Install Java
sudo apt-get install default-jre
// Install Tomcat and Tomcat admin
sudo apt-get install tomcat9
sudo apt-get install tomcat9-admin