SocketNet
1.0
A Socket Networking (C/S) Library
|
SocketNet ライブラリのサンプルプログラム (簡単なチャットクライアント)。 [詳解]
公開メンバ関数 | |
ChatClient () | |
コンストラクタ。 [詳解] | |
ChatClient (TcpConnection connection) | |
コンストラクタ。 [詳解] | |
ChatClient (IPEndPoint serverEndPoint) | |
コンストラクタ。 [詳解] | |
ChatClient (IPAddress serverIPAddress, int serverPort) | |
コンストラクタ。 [詳解] | |
void | Connect () |
サーバに接続します。 [詳解] | |
void | Connect (IPEndPoint serverEndPoint) |
指定されたエンドポイントのサーバに接続します。 [詳解] | |
void | Connect (IPAddress serverIPAddress, int serverPort) |
指定されたIPアドレスとポート番号のサーバに接続します。 [詳解] | |
void | Close () |
接続を閉じます。 [詳解] | |
void | BeginReceiveMessage () |
メッセージの受信を開始します。 [詳解] | |
void | Send (ChatMessage message) |
指定されたチャットメッセージを送信します。 [詳解] | |
プロパティ | |
IPAddress | RemoteIPAddress [get, private set] |
接続先のIPアドレスを取得します。 [詳解] | |
int | RemotePort [get, private set] |
接続先のポート番号を取得します。 [詳解] | |
TcpConnection | Connection [get, private set] |
接続を取得します。 [詳解] | |
bool | IsConnected [get] |
接続しているかどうかを取得します。 [詳解] | |
イベント | |
EventHandler< ChatMessageReceivedEventArgs > | ChatMessageReceived |
チャットメッセージを受信した時に発行されます。 [詳解] | |
非公開メンバ関数 | |
void | OnDataReceived (object sender, TcpDataReceivedEventArgs e) |
Tcpパケットを受信したときにチャットメッセージに変換して、メッセージ受信イベントを発行します。 [詳解] | |
SocketNet ライブラリのサンプルプログラム (簡単なチャットクライアント)。
SampleChatClient.ChatClient.ChatClient | ( | ) |
コンストラクタ。
SampleChatClient.ChatClient.ChatClient | ( | TcpConnection | connection | ) |
SampleChatClient.ChatClient.ChatClient | ( | IPEndPoint | serverEndPoint | ) |
コンストラクタ。
serverEndPoint | サーバのエンドポイント。 |
SampleChatClient.ChatClient.ChatClient | ( | IPAddress | serverIPAddress, |
int | serverPort | ||
) |
コンストラクタ。
serverIPAddress | サーバのIPアドレス。 |
serverPort | サーバのポート番号。 |
参照先 SampleChatClient.ChatClient.RemoteIPAddress, SampleChatClient.ChatClient.RemotePort.
void SampleChatClient.ChatClient.BeginReceiveMessage | ( | ) |
メッセージの受信を開始します。
参照先 SampleChatClient.ChatClient.Connection, SocketNet.TcpConnection.ReceiveDataAsync().
参照元 MainWindow.OnConnectButtonClicked().
void SampleChatClient.ChatClient.Close | ( | ) |
接続を閉じます。
参照先 SampleChatClient.ChatClient.Connection, SocketNet.TcpConnection.Dispose().
参照元 MainWindow.OnDisconnectButtonClicked().
void SampleChatClient.ChatClient.Connect | ( | ) |
void SampleChatClient.ChatClient.Connect | ( | IPEndPoint | serverEndPoint | ) |
指定されたエンドポイントのサーバに接続します。
serverEndPoint | サーバのエンドポイント。 |
参照先 SampleChatClient.ChatClient.Connect().
void SampleChatClient.ChatClient.Connect | ( | IPAddress | serverIPAddress, |
int | serverPort | ||
) |
指定されたIPアドレスとポート番号のサーバに接続します。
serverIPAddress | サーバのIPアドレス。 |
serverPort | サーバのポート番号。 |
参照先 SampleChatClient.ChatClient.Connection, SocketNet.TcpConnection.DataReceived, SampleChatClient.ChatClient.OnDataReceived(), SampleChatClient.ChatClient.RemoteIPAddress, SampleChatClient.ChatClient.RemotePort.
|
private |
Tcpパケットを受信したときにチャットメッセージに変換して、メッセージ受信イベントを発行します。
sender | センダ。 |
e | イベントデータを格納するオブジェクト。 |
参照先 SampleChatClient.ChatClient.ChatMessageReceived, SocketNet.TcpDataReceivedEventArgs.Connection, SampleChatClient.ChatMessage.Connection, SocketNet.TcpDataReceivedEventArgs.Data, SampleChatClient.ChatMessage.FromByteArray().
参照元 SampleChatClient.ChatClient.Connect().
void SampleChatClient.ChatClient.Send | ( | ChatMessage | message | ) |
指定されたチャットメッセージを送信します。
message | メッセージ。 |
参照先 SampleChatClient.ChatClient.Connection, SampleChatClient.ChatMessage.ToByteArray(), SocketNet.TcpConnection.Writer.
参照元 MainWindow.OnSendButtonClicked().
|
getprivate set |
|
get |
接続しているかどうかを取得します。
|
getprivate set |
接続先のIPアドレスを取得します。
The remote IP address.
参照元 SampleChatClient.ChatClient.ChatClient(), SampleChatClient.ChatClient.Connect().
|
getprivate set |
接続先のポート番号を取得します。
The remote port.
参照元 SampleChatClient.ChatClient.ChatClient(), SampleChatClient.ChatClient.Connect().
EventHandler<ChatMessageReceivedEventArgs> SampleChatClient.ChatClient.ChatMessageReceived |
チャットメッセージを受信した時に発行されます。
参照元 MainWindow.OnConnectButtonClicked(), SampleChatClient.ChatClient.OnDataReceived().