Ejemplo n.º 1
0
		public static int Write(this IPCPipe pipe, Handle handle, Encoding enc, string text)
		{
			return pipe.Write(enc, text, null);
		}
Ejemplo n.º 2
0
		public static int Write(this IPCPipe pipe, Handle handle, string text)
		{
			return pipe.Write(Encoding.Default, text);
		}
Ejemplo n.º 3
0
		public static int Write(this IPCPipe pipe, Handle handle, Encoding enc, string text, Action<Exception> callback)
		{
			var bytes = enc.GetBytes(text);
			pipe.Write(handle, bytes, callback);
			return bytes.Length;
		}
Ejemplo n.º 4
0
		public static int Write(this IPCPipe pipe, Handle handle, string text, Action<Exception> callback)
		{
			return pipe.Write(handle, Encoding.Default, text, callback);
		}
Ejemplo n.º 5
0
		public static void Write(this IPCPipe pipe, Handle handle, byte[] data, Action<Exception> callback)
		{
			pipe.Write(handle, data, 0, callback);
		}
Ejemplo n.º 6
0
		public static void Write(this IPCPipe pipe, Handle handle, byte[] data)
		{
			pipe.Write(handle, data, null);
		}
Ejemplo n.º 7
0
		public static void Write(this IPCPipe pipe, Handle handle, byte[] data, int index, int count)
		{
			pipe.Write(handle, data, index, count, null);
		}
Ejemplo n.º 8
0
		public static void Write(this IPCPipe pipe, Handle handle, byte[] data, int index, Action<Exception> callback)
		{
			Ensure.ArgumentNotNull(data, "data");
			pipe.Write(handle, data, index, data.Length - index, callback);
		}
Ejemplo n.º 9
0
		public static void Write(this IPCPipe pipe, Handle handle, byte[] data, int index, int count, Action<Exception> callback)
		{
			pipe.Write(handle, new ArraySegment<byte>(data, index, count), callback);
		}
Ejemplo n.º 10
0
		internal static void Bind(Handle handle, bind bind, bind6 bind6, IPAddress ipAddress, int port, bool dualstack)
		{
			Ensure.AddressFamily(ipAddress);

			int r;
			if (ipAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) {
				sockaddr_in address = UV.ToStruct(ipAddress.ToString(), port);
				r = bind(handle.NativeHandle, ref address, 0);
			} else {
				sockaddr_in6 address = UV.ToStruct6(ipAddress.ToString(), port);
				r = bind6(handle.NativeHandle, ref address, (uint)(dualstack ? 0 : 1));
			}
			Ensure.Success(r);
		}
Ejemplo n.º 11
0
		unsafe internal static IPEndPoint GetSockname(Handle handle, uv_getsockname getsockname)
		{
			sockaddr_in6 addr;
			IntPtr ptr = new IntPtr(&addr);
			int length = sizeof(sockaddr_in6);
			int r = getsockname(handle.NativeHandle, ptr, ref length);
			Ensure.Success(r);
			return UV.GetIPEndPoint(ptr, true);
		}
Ejemplo n.º 12
0
		public static extern int uv_listen(IntPtr stream, int backlog, Handle.callback callback);
Ejemplo n.º 13
0
 internal static IntPtr Alloc(HandleType type)
 {
     return(Alloc(Handle.Size(type)));
 }