Server socket don't close on OmmProvider destroying.

I want to use an Interactive Provider as a server in my application. An object of OmmProvider is correctly created, configured as IProvider, binds socket and works well with all test Consumer apps, but when it comes to destroying an object and closing socket, it stays binded. So, next time I want to create a new OmmProvider object on this same port, it throws an exception (Error: 1002 Unable to bind socket. System errno: (98)) and can't bind second time. Using ServerSharedSocket=1 config option results in consumers just connecting to the old socket, ignoring a new one. Socket is closed well when the process is killed, but unfortunately, killing process is not an option, an app needs to be up and running all the time. In addition, there is a rsslCloseServer() method mentioned in Eta documentation. I guess this is what I need, but I don't see any way to call it on an Ema level. I cannot see any usages of it in the test examples of Ema either.
Could you please suggest how I can correctly close a OmmProvider's socket on Ema level without killing a process? Maybe there is some Server or Provider configuration option that I am missing?
Best Answer
-
Thank you for the code.
The problem happens on Linux, but not on Windows.
If you are RDC (Refinitiv Developer Connect) subscriber, you can directly submit this issue to the API support team via Contact Premium Support to verify the problem.
Otherwise, you can raise this issue via Refinitiv Real-Time SDK Github.
0
Answers
-
I have modified the C++ IProv100 example in the RTSDK-2.0.1.L2.win.rrg (EMA 3.6.1.L2) package to creating a new OmmProvider after deleting the previous one. The code looks like this:
int main()
{
try
{
AppClient appClient;
while (true) {
printf("Create OmmProvider\n");
OmmProvider* provider = new OmmProvider(OmmIProviderConfig().port("14002"), appClient);
itemHandle = 0;
while (itemHandle == 0) sleep(1000);
for (Int32 i = 0; i < 10; i++)
{
provider->submit(UpdateMsg().payload(FieldList().
addReal(22, 3391 + i, OmmReal::ExponentNeg2Enum).
addReal(30, 10 + i, OmmReal::Exponent0Enum).
complete()), itemHandle);
sleep(1000);
}
printf("Delete OmmProvider\n");
delete(provider);
sleep(5000);
};
}
catch ( const OmmException& excp )
{
cout << excp << endl;
}
return 0;
}From my testing, the application can close and reopen TCP 14002 port properly.
0 -
On top of @Jirapongse answer, I also tested com.refinitiv.ema.examples.training.iprovider.series100.ex100_MP_Streaming on EMA Java.
And it works fine as well.
0 -
@Jirapongse @chavalit-jintamalit , thank you for your investigations!
I've also tried to reproduce this issue with a minimal code. Here it is, three simple steps, even without sending anything (modified IProv100):
Creating a OmmProvider object, destroying it and creating a new one on the same port.
Here is the output:
Creating provider
Deleting provider
Creating provider one more time
Exception Type='OmmInvalidUsageException', Text='Failed to initialize OmmServerBaseImpl (Unable to bind RSSL server).' Error Id='-1' Internal sysError='98' ..........
Worth to mention, I'm running a RHEL7 (Red Hat Enterprise Linux Server release 7.4 (Maipo)) and using Clang 10.0.1 compiler. (Also tried with GCC 4.8.5, but it's all the same).
I've also checked executable's syscalls with "strace" utility. There is a socket creation with "socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)", which returned "10", but there is no "close(10)" call after it to actually close it.
Debugging Ema's code gave no results too. All methods, used in d-tor, returned success code, but still no close(..) called.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛