FIX Protocol 4.4 Connection not responding to Login - authentication

To anyone who can help,
I am having a show stopping issue connecting to the test server.
My TCP/IP connection is established via:
Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
I send the connection message to the server via:
_socket.Send(_txData);
where _txData is a byte[] _txData array initialized with the connection request message:
8=FIX.4.4\0019=121\00135=A\00149=NotRealSenderID\0 0156=NotRealTargetID\00134=1\00152=20140522-20:12:04.392\00198=0\001108=30\001554=NotRealPassw ord\00110=017\001 converted to a byte array.
I wait for the login success message via:
int responseCount = _socket.Receive(_rxBuffer);
but after a few seconds, the _socket.Receive unblocks and returns zero bytes suggesting unsuccessful connection.
What am I doing wrong?
Is my login message at fault? Is it the way I establish server connection? I am at a loss!
Currently, My default Windows 7 Firewall is disabled, and I attempted to telnet into the server, and the image below snapshots the outcome:
Any help will be appreciated, as this is a major show stopper for me.
Thanks.

I managed to resolve this issue. The problem was with the SOH character in my message.
I was using the literal SOH = "\001" converted to a byte, when I should have done this: SOH = (char) 0x1; DUH!!
For the record, I used the following tools to 'debug' this issue:
Wireshark with display filter and capture filter set to the host server's ip address, and MINI-FIX to generate and transmit FIX messages to the host server.
I then compared the output from my client to those produced by MINI-FIX via Wireshark. It didn't take me long to spot the error from there.

What is "the test server" ?
Can you ping it ?
From the look of that telnet session you haven't permission to make a connection, or there is nothing running at the destination.

Related

Problem in sending email with exim in cpanel to extern address

I noticed today that mails do not come through. Since several hours ago, all mails just get stuck in queue. I have tried to deliver them manually, by selecting one mail in WHM Mail Queue Manager and clicking on "Deliver Selected", but after few minutes I just get this error:
Code:
LOG: MAIN
cwd=/usr/local/cpanel/whostmgr/docroot 4 args: /usr/sbin/exim -v -M 1Tli6y-0002Xo-KW
delivering 1Tli6y-0002Xo-KW
Connecting to foobar.TLD [IP.ADDRESS]:25 ... failed: Connection timed out (timeout=5m)
LOG: MAIN
foobar.TLD [IP.ADDRESS] Connection timed out
LOG: MAIN
== info#foobar.TLD R=dkim_lookuphost T=dkim_remote_smtp defer (110): Connection timed out
I have searched on net, and I have found thread on this forum, similar error - http://forums.cpanel.net/f43/t-remote_smtp-defer-53-retry-time-not-reached-any-host-72383.html
and there is proposed solution, but I am not sure should it work in my case. I can not risk loosing emails in queue, my clients would hang me :)
I can see your server is unable to connect remote server to send your mail. Because you are getting "25 ... failed: Connection timed out" error in logs. I think your mail server IP is blacklisted in anti-spam databases and maybe due to that you are getting this issues.
run command
exim -bt info#foobar.tld
Copy ip address and add your CSF white list.
Or turn of Firewall and retest.

Bio_free not closing connection

I have developed a ssl client using the code shown in this website
http://www.chesterproductions.net.nz/blogs/it/c/an-ssl-client-using-openssl/245/
But after calling r = BIO_free(bio); the connection still does not get closed. Only after closing my client application does the connection close.
I am verifying this using CurrPorts software, which shows which all ports are in connected state.
I have tried BIO_ssl_shutdown(bio); but it didnt work either.
Ok I found the fault. It was the server not clearing its FD_SET which was creating an issue. Though I am not sure why it happened so :(

how do i stop reqest.finish() (twisted .web server)from closing the http connection

I have written a chat server which writes a message line on the browser of one client to other client. The problem is that if i use request.finish() the output is shown but the connection is closed .if i dont use request.finish () the browser or program buffers the output and displaying output only after 20 or so request have been send.however the connection remains open.
I think best approach is reconnecting client just after receiving a message and closing connection.

TcpListener actively refused connection

I am maintaining an application that uses a TcpListener to listen for incoming communication. The following code opens the connection:
Dim listener As TcpListener
_listenFailed = False
Try
listener = New TcpListener(System.Net.IPAddress.Parse(Me.Host), Me.Port)
listener.Start()
Catch ex As Exception
' an error here means the settings are likely bogus
_listenFailed = True
Return
End Try
While Not _stoplistening
{
' Accept connection
}
The problem that I am having is that when i send a file from a different computer, I get the error "No connection could be made because the target machine actively refused it."
I have checked for firewalls and antivirus, and there were no blocks. I used
netstat -a -n
to determine that the port is active and listening. Both applications are running from Visual Studios in Administrator mode, not that this should make a difference. I have a break point set at the first line of the accept connection code, but it never gets run.
I stopped the application and examined the TcpListener, and found that there were a couple errors if I dug deep down. At TcpListener.LocalEndpoint.IPEndPoint.IPAddress.Address.ErrorCode there was the error 10045, "OperationNotSupported". Also, at TcpListener.Socket.RemoteEndPoint.ErrorCode there was an error 1057, "A request to send or receive data was disallowed because the socket is not connected, and (when sending on a datagram socket using a sendto call) no address was supplied. I don't know if either of these errors are relevant.
If anyone has any insights as to what might be causing this problem, or steps that can be taken to trace the root of the issue, I would be grateful.
Try changing this:
listener = New TcpListener(System.Net.IPAddress.Parse(Me.Host), Me.Port)
To this:
listener = New TcpListener(System.Net.IPAddress.Any, Me.Port)
This will allow you to listen across all network interfaces.
Additionally, you can use IPv6Any instead of Any if you want to target IPv6 instead. This choice has an impact on the address used by the client side obviously.

MailMessage & MAIL/EXPN/VRFY/ETRN

I was told that my program was not issuing a MAIL/EXPN/VRFY/ETRN when sending an email by the web hosting company we are connecting to.
Anyone know what this means and how I do it?
I am sending an email with SmtpClient and I have no problems with other clients.
Here is what I was told:
Thanks for the additional info, here
is what I found...
Aug 4 11:16:48 smtp1 sendmail[2729]:
o74GGU5F002729:
xx-xx-xx-xx.static.xxx.mo.charter.com
[xx.xx.xx.xx] did not issue
MAIL/EXPN/VRFY/ETRN during connection
to TLSMTA
Notice the time and the IP address
which is your static from Charter. Now
here is a good connection.
Aug 4 11:18:22 smtp1 sendmail[2745]:
STARTTLS=server,
relay=xx.xx.xx.xx.static.xxx.mo.charter.com [xx.xx.xx.xx], version=TLSv1/SSLv3,
verify=NO, cipher=RC4-MD5,
bits=128/128 Aug 4 11:18:23 smtp1
sendmail[2745]: AUTH=server,
relay=xx.xx.xx.xx.static.stls.mo.charter.com
[xx.xx.xx.xx], authid=ronmid,
mech=LOGIN, bits=0
Since their email program did not
issue MAIL/EXPN/VRFY/ETRN during
connection, my server would not
continue the transaction.
Any suggestions?
Thanks!
You app didn't issue any of those 4 commands after connecting. This could be because the server didn't respond correctly and so your app was waiting for that response until it timed out. You can check this by trying to send an email with a simple telnet connection as described here. After you connect and send the EHLO or HELO command (depending on what the server wants) you should get a 250 response.
If you do get the 250 response with telnet but your app still doesn't work, then maybe it's something in your application that tries to send an incorrect command. Maybe you've setup your application to use SSL or credentials, and the SMTP server don't support that or something similar?