C# 개발환경에서는 되는데 실행모듈은 에러나는 이유..

phynix의 이미지

Visual Studio 2005 씁니다.

C++ static library를 C#에서 System.data.Odbc 처럼 wrapper 하는 DLL 작성 중입니다.

C# 에서 직접 static 쓰기 어려우니 /clr 옵션 주어서 한번더 wrapper 한 DLL을 작성하고
C# 에서 호출하니...

개발환경에서 debug 돌리면서 수행해보면 잘 수행되고 결과도 잘 나옵니다.

그런데..

bin/debug 에 생성된 C# 실행모듈을 직접 수행하면 오류가 나네요.

Connection 하는 부분이 꼭 걸립니다.

Connection 앞에서 환경설정이나 메모리 alloc하는 부분은 모두 성공적으로 호출되는데
어찌 Connection 부분에서는 에러가 나는지...

Debug 걸 수도 없네요...거기서는 잘되니..

이런 경우도 있나요??

phynix의 이미지

음..점점 진행해보니 errno 문제군요.

debug trace를 수행하니깐 WindowApplication1.vshost.exe 가 구동되고 errno가 잘 세팅됩니다.
그래서 socket connect 도 잘 되네요.

직접 실행모듈을 돌리면 errno 가 엉뚱한 값이 나옵니다..쩝..
실제로는 접속이 잘 됐으면서도 EWOULDBLOCK 이 아닌 다른 값이어서 그냥 튕겨 나가는 군요.

특이한 것은 Consol mode로 만들면 또 실행이 잘되네요..

어쩐 일인지..

익명사용자의 이미지

EWOULDBLOCK는 non-blocking 모드일때 전송이 완료가 덜 되었을때 나타나는 에러입니다.
일단 socket으로 하신다고 하시니 send에서 저 error가 발상하면 보낸 byte를 확인하시후 남은 바이트를
더 전송해주시면 됩니다.
일단 저건 에러가 아닙니다.
그럼

byung82의 이미지

odbc를 wrapper 해서 사용하실 이유가 있으신가여 ?

제 생각은 System.Data.Odbc에 클래스들을 사용하시는게 더 득을것 같습니다.

odbc의 어떤 기능을 쓰실건지 더 말씀해 주시기 바랍니다

김일영의 이미지

뭔가 race condition의 영향을 받는 것으로 봐서 멀티쓰레드와 관계가 있지 않나 생각됩니다.
더 이상은 말씀하신 내용에서 짐작하기가 힘들군요. 일단 방향을 그쪽으로 생각해보시면 뭔가 실마리가 잡히지 않을까 싶네요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.