This repository was archived by the owner on Mar 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSocket.cs
More file actions
80 lines (57 loc) · 2.55 KB
/
Socket.cs
File metadata and controls
80 lines (57 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using NodeJS.BufferModule;
using NodeJS.EventsModule;
namespace NodeJS.DgramModule {
[Imported]
[ModuleName("dgram")]
[IgnoreNamespace]
public class Socket : EventEmitter {
private Socket() {}
public void Send(Buffer buf, int offset, int length, int port, string address) {}
public void Send(Buffer buf, int offset, int length, int port, string address, Action<Error, int> callback) {}
[InlineCode("{$System.Threading.Tasks.Task}.fromNode({this}, 'send', {offset}, {length}, {port}, {address})")]
public Task<int> SendTask(Buffer buf, int offset, int length, int port, string address) { return null; }
public void Bind(int port) {}
public void Bind(int port, string address) {}
public void Close() {}
public NetModule.SocketAddress Address { [ScriptName("address")] get { return null; } }
public void SetBroadcast(bool flag) {}
[ScriptName("setTTL")]
public void SetTTL(int ttl) {}
[ScriptName("setMulticastTTL")]
public void SetMulticastTTL(int ttl) {}
public void SetMulticastLoopback(bool flag) {}
public void AddMembership(string multicastAddress) {}
public void AddMembership(string multicastAddress, string multicastInterface) {}
public void DropMembership(string multicastAddress) {}
public void DropMembership(string multicastAddress, string multicastInterface) {}
public event Action<Buffer, object> OnMessage {
[InlineCode("{this}.addListener('message', {value})")] add {}
[InlineCode("{this}.removeListener('message', {value})")] remove {}
}
[InlineCode("{this}.once('message', {callback})")]
public void OnceMessage(Action<Buffer, object> callback) {}
public event Action OnListening {
[InlineCode("{this}.addListener('listening', {value})")] add {}
[InlineCode("{this}.removeListener('listening', {value})")] remove {}
}
[InlineCode("{this}.once('listening', {callback})")]
public void OnceListening(Action callback) {}
public event Action OnClose {
[InlineCode("{this}.addListener('close', {value})")] add {}
[InlineCode("{this}.removeListener('close', {value})")] remove {}
}
[InlineCode("{this}.once('close', {callback})")]
public void OnceClose(Action callback) {}
public event Action<Error> OnError {
[InlineCode("{this}.addListener('error', {value})")] add {}
[InlineCode("{this}.removeListener('error', {value})")] remove {}
}
[InlineCode("{this}.once('error', {callback})")]
public void OnceError(Action<Error> callback) {}
}
}