私は 1 つのライブラリ (DLL) を開発しています。このライブラリでは、データを含む 1 つのメソッドとしてユーザーにイベント (割り込み) を提供する必要があります。ライブラリの作業は、ソケットでリストを開始し、ソケットからデータを受け取り、このデータを 1 つのメソッドでユーザーに渡すことです。
としょうかん:
public void start(string IP, int port)
{
// start logic...
// receives data from socket... send this data to user
}
応用:
Library. Class a = new Library. Class();
a.start(ip, port);
// I need this method called by library automatically when it receives data...
void receivedData(string data)
{
// data which received by library....
}
ライブラリからのデータを使用してアプリケーションにイベントを発生させる方法は?
前もって感謝します....