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.phuriphanvichai 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.phuriphanvichai @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
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛